diff --git a/client/components/edit-document-list/index.tsx b/client/components/edit-document-list/index.tsx index 49144473..9822b916 100644 --- a/client/components/edit-document-list/index.tsx +++ b/client/components/edit-document-list/index.tsx @@ -2,11 +2,12 @@ import type { Document } from "@lib/types" import DocumentComponent from "@components/edit-document" import { ChangeEvent, memo, useCallback } from "react" -const DocumentList = ({ docs, removeDoc, updateDocContent, updateDocTitle }: { +const DocumentList = ({ docs, removeDoc, updateDocContent, updateDocTitle, onPaste }: { docs: Document[], updateDocTitle: (i: number) => (title: string) => void updateDocContent: (i: number) => (content: string) => void removeDoc: (i: number) => () => void + onPaste: (e: any) => void }) => { const handleOnChange = useCallback((i) => (e: ChangeEvent) => { updateDocContent(i)(e.target.value) @@ -16,6 +17,7 @@ const DocumentList = ({ docs, removeDoc, updateDocContent, updateDocTitle }: { docs.map(({ content, id, title }, i) => { return ( void + onPaste?: (e: any) => void } -const Document = ({ remove, title, content, setTitle, setContent, initialTab = 'edit', skeleton, handleOnContentChange }: Props) => { +const Document = ({ onPaste, remove, title, content, setTitle, setContent, initialTab = 'edit', skeleton, handleOnContentChange }: Props) => { const codeEditorRef = useRef(null) const [tab, setTab] = useState(initialTab) // const height = editable ? "500px" : '100%' @@ -54,7 +55,7 @@ const Document = ({ remove, title, content, setTitle, setContent, initialTab = ' if (skeleton) { return <> - +
{remove && } @@ -63,7 +64,7 @@ const Document = ({ remove, title, content, setTitle, setContent, initialTab = '
- +
} @@ -90,8 +91,9 @@ const Document = ({ remove, title, content, setTitle, setContent, initialTab = ' {/* */} -
+
*/} -
+