import { useTheme } from "@emotion/react"; import { Box } from "@mui/material"; import DocumentComponent from "../documentComponent"; import { useEffect } from "react"; import baseUrl from "@/services/api/api.config"; export default function PreviewDocuments({ documents, fetchDocuments, fetchChunks }) { const theme = useTheme(); const deleteDcoument = async (documentId) => { const url = `${baseUrl}/upload/delete_document/${documentId}`; await fetch(url, { method: "DELETE", headers: { "Content-Type": "application/json" }, }) .then(fetchDocuments()) .then(fetchChunks()); }; useEffect(() => {}, [documents]); return ( <> {documents.map((document, index) => ( ))} ); }