diff --git a/ui/src/components/docs-input.tsx b/ui/src/components/docs-input.tsx index 2d5893d..ceaec0d 100644 --- a/ui/src/components/docs-input.tsx +++ b/ui/src/components/docs-input.tsx @@ -1,37 +1,35 @@ import { useState } from "react"; -import { FileText } from "lucide-react"; +import UploadPreview from "./upload-preview"; const DocsInput: React.FC<{ fileRef: React.RefObject; }> = ({ fileRef }) => { - const [fileName, setFileName] = useState(undefined); + const [fileNames, setFileNames] = useState([]); - const getFileName = () => { + const getFileNames = () => { if (fileRef.current?.files != null) { - setFileName(fileRef.current.files[0].name); + let names = []; + + for (let file of fileRef.current.files) { + names.push(file.name); + } + + setFileNames(names); } }; return ( -
-
- {fileName ? ( -
- - {fileName} -
- ) : ( -
- -
- )} +
+
+