import baseUrl from "@/services/api/api.config"; import { useTheme } from "@emotion/react"; import { Box } from "@mui/material"; import { useEffect } from "react"; import DocumentComponent from "../documentComponent"; 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) => ( ))} ); }