diff --git a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx index 976c6598..a8526908 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx @@ -4,44 +4,12 @@ import { getFileExtension, middleTruncate, } from "@/utils/directories"; -import { File, Trash } from "@phosphor-icons/react"; -import System from "@/models/system"; +import { File } from "@phosphor-icons/react"; import debounce from "lodash.debounce"; -export default function FileRow({ - item, - folderName, - selected, - toggleSelection, - fetchKeys, - setLoading, - setLoadingMessage, -}) { +export default function FileRow({ item, selected, toggleSelection }) { const [showTooltip, setShowTooltip] = useState(false); - const onTrashClick = async (event) => { - event.stopPropagation(); - if ( - !window.confirm( - "Are you sure you want to delete this document?\nThis will require you to re-upload and re-embed it.\nThis document will be removed from any workspace that is currently referencing it.\nThis action is not reversible." - ) - ) { - return false; - } - - try { - setLoading(true); - setLoadingMessage("This may take a while for large documents"); - await System.deleteDocument(`${folderName}/${item.name}`); - await fetchKeys(true); - } catch (error) { - console.error("Failed to delete the document:", error); - } - - if (selected) toggleSelection(item); - setLoading(false); - }; - const handleShowTooltip = () => { setShowTooltip(true); }; @@ -60,7 +28,7 @@ export default function FileRow({ selected ? "selected" : "" }`} > -
Cached
- {middleTruncate(item.name, 40)} + {middleTruncate(item.name, 35)}
Name
Date
Kind