import type { Document } from "../new" import DocumentComponent from "./edit-document" import { ChangeEvent, useCallback } from "react" 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: number) => (e: ChangeEvent) => { updateDocContent(i)(e.target.value) }, [updateDocContent] ) return ( <> {docs.map(({ content, id, title }, i) => { return ( ) })} ) } export default DocumentList