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, fetchChunks }) { const theme = useTheme(); const deleteDcoument = async (documentName) => { const url = `${baseUrl}/document/delete_document/${encodeURIComponent( documentName )}`; const result = await fetch(url, { method: "DELETE", headers: { "Content-Type": "application/json" }, }); await fetchChunks(); }; useEffect(() => {}, [documents]); return ( <> {documents.map((document, index) => ( ))} ); }