diff --git a/src/widgets/action-editor/ui/ActionEditor.tsx b/src/widgets/action-editor/ui/ActionEditor.tsx index f30a221..3fe09d3 100644 --- a/src/widgets/action-editor/ui/ActionEditor.tsx +++ b/src/widgets/action-editor/ui/ActionEditor.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useState, useRef } from "react"; import { uploadFile } from "@/shared/lib/uploadFile"; import type { CommentAction } from "@/entities/action/schema"; import { getActionAttachmentType } from "@/entities/action/lib"; @@ -58,6 +58,7 @@ export default function ActionEditor({ onClose, canExit = false, }: ActionEditorProps) { + const imageRef = useRef(null); const attachmentType = initialAction ? getActionAttachmentType(initialAction) : "empty"; @@ -179,16 +180,42 @@ export default function ActionEditor({
+
+
+ + {imageUrl && ( + Current image + )} +
+ + {loading && ( +
+ +
+ )} +
+ await handleFileChange(e, "image")} /> - {loading && ( -
- -
- )}