dynmic text
This commit is contained in:
@@ -62,13 +62,29 @@ const FeatureCarousel = ({
|
||||
return getCreationStageStates(selectedProject);
|
||||
}, [stageStatesProp, selectedProject]);
|
||||
|
||||
const stageStatesByKey = useMemo(() => {
|
||||
if (!Array.isArray(stageStates)) {
|
||||
return {};
|
||||
}
|
||||
return stageStates.reduce((acc, stage) => {
|
||||
if (stage?.key) {
|
||||
acc[stage.key] = stage;
|
||||
}
|
||||
return acc;
|
||||
}, {});
|
||||
}, [stageStates]);
|
||||
|
||||
const carouselItems = useMemo(
|
||||
() =>
|
||||
STAGE_CARD_CONTENT.map((item, index) => ({
|
||||
...item,
|
||||
isLocked: stageStates[index]?.isLocked ?? true,
|
||||
})),
|
||||
[stageStates],
|
||||
STAGE_CARD_CONTENT.map((item) => {
|
||||
const state = stageStatesByKey[item.key];
|
||||
return {
|
||||
...item,
|
||||
isLocked: state?.isLocked ?? true,
|
||||
description: state?.description ?? item.description,
|
||||
};
|
||||
}),
|
||||
[stageStatesByKey],
|
||||
);
|
||||
|
||||
const { height: windowHeight } = useWindowDimensions();
|
||||
|
||||
Reference in New Issue
Block a user