diff --git a/servers/nextjs/app/(presentation-generator)/components/IconsEditor.tsx b/servers/nextjs/app/(presentation-generator)/components/IconsEditor.tsx index 1b8ecf12..1fe60fb0 100644 --- a/servers/nextjs/app/(presentation-generator)/components/IconsEditor.tsx +++ b/servers/nextjs/app/(presentation-generator)/components/IconsEditor.tsx @@ -28,6 +28,7 @@ interface IconsEditorProps { isWhite?: boolean; className?: string; icon_prompt?: string[] | null; + onClose?: () => void; } const IconsEditor = ({ @@ -39,6 +40,7 @@ const IconsEditor = ({ slideIndex, elementId, icon_prompt, + onClose, }: IconsEditorProps) => { const dispatch = useDispatch(); @@ -97,124 +99,76 @@ const IconsEditor = ({ }; return ( - <> -
onClose?.()}> + e.preventDefault()} > - {icon ? ( - slide icon + Choose Icon + +
+
{ + e.preventDefault(); + handleIconSearch(); }} - data-slide-index={slideIndex} - data-element-type="picture" - data-is-icon - data-element-id={`${elementId}-image`} - data-is-network={false} - data-image-path={icon} - /> - ) : ( -
- - {initialIcon !== undefined && ( -

- -

+ > +
+ + + setSearchQuery(e.target.value)} + className="pl-10" + /> +
+ + + + {/* Icons grid */} +
+ {loading ? ( +
+ {Array.from({ length: 40 }).map((_, index) => ( + + ))} +
+ ) : icons.length > 0 ? ( +
+ {icons.map((iconSrc, idx) => ( +
handleIconChange(iconSrc)} + className="w-12 h-12 cursor-pointer group relative rounded-lg overflow-hidden hover:bg-gray-100 p-2" + > + {`Icon +
+ ))} +
+ ) : ( +
+ +

No icons found for your search.

+

Try refining your search query.

+
)}
- )} - {/* Hover overlay */} -
-
- - - e.preventDefault()} - > - - Choose Icon - -
-
{ - e.preventDefault(); - handleIconSearch(); - }} - > -
- - - setSearchQuery(e.target.value)} - className="pl-10" - /> -
- -
- - {/* Icons grid */} -
- {loading ? ( -
- {Array.from({ length: 40 }).map((_, index) => ( - - ))} -
- ) : icons.length > 0 ? ( -
- {icons.map((iconSrc, idx) => ( -
handleIconChange(iconSrc)} - className="w-12 h-12 cursor-pointer group relative rounded-lg overflow-hidden hover:bg-gray-100 p-2" - > - {`Icon -
- ))} -
- ) : ( -
- -

No icons found for your search.

-

Try refining your search query.

-
- )} -
-
-
-
- +
+ + ); }; diff --git a/servers/nextjs/app/(presentation-generator)/components/ImageEditor.tsx b/servers/nextjs/app/(presentation-generator)/components/ImageEditor.tsx index de66031f..159abdac 100644 --- a/servers/nextjs/app/(presentation-generator)/components/ImageEditor.tsx +++ b/servers/nextjs/app/(presentation-generator)/components/ImageEditor.tsx @@ -45,6 +45,7 @@ interface ImageEditorProps { className?: string; promptContent?: string; properties?: null | any; + onClose?: () => void; } const ImageEditor = ({ @@ -56,6 +57,7 @@ const ImageEditor = ({ elementId, promptContent, properties, + onClose, }: ImageEditorProps) => { const dispatch = useDispatch(); @@ -289,376 +291,178 @@ const ImageEditor = ({ }; return ( - <> -
{ - if (initialImage !== undefined) { - if (isFocusPointMode) { - handleFocusPointClick(e); - } else { - handleImageClick(); - } - } - }} + onClose?.()}> + e.preventDefault()} > - {image ? ( - {title} - ) : ( -
- - { -

- {initialImage !== undefined - ? "Click to add image" - : "Loading..."} -

- } -
- )} + + Update Image + -
+
+ + + + AI Generate + - {isFocusPointMode && ( -
-
-

- Click anywhere to set focus point -

- -
+ + Upload + + - {/* Focus point marker */} -
-
-
-
-
-
-
-
- )} + +
+
+
+

Current Prompt

- {/* Image Toolbar */} - {isToolbarOpen && !isFocusPointMode && ( -
-
- - - - - - - - - - - - -
- - - -
-
-
-
-
- )} -
- - - e.preventDefault()} - > - - Update Image - - -
- - - - AI Generate - - - - Upload - - - - -
-
-
-

Current Prompt

- -

{promptContent}

-
-
-

- Image Description -

-