{
- setChangeToType(type as TSurveyElementTypeEnum);
- if ((card as EditorCardMenuSurveyElement).logic) {
- setLogicWarningModal(true);
- return;
- }
+ {groupedElementTypes
+ .map((group) => ({
+ ...group,
+ elements: group.elements.filter((elementType) => elementType.id !== card.type),
+ }))
+ .filter((group) => group.elements.length > 0)
+ .map((group, index) => (
+
+ {index > 0 && }
+
+ {group.category.label}
+
+ {group.elements.map((elementType) => (
+ {
+ setChangeToType(elementType.id as TSurveyElementTypeEnum);
+ if ((card as EditorCardMenuSurveyElement).logic) {
+ setLogicWarningModal(true);
+ return;
+ }
- changeElementType(type as TSurveyElementTypeEnum);
- }}
- icon={ELEMENTS_ICON_MAP[type as TSurveyElementTypeEnum]}>
- {name}
-
- );
- })}
+ changeElementType(elementType.id as TSurveyElementTypeEnum);
+ }}
+ icon={}>
+ {elementType.label}
+
+ ))}
+
+ ))}