diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx index f041c21..ae492e7 100644 --- a/src/components/layout/Sidebar.tsx +++ b/src/components/layout/Sidebar.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { MessageSquare, Settings, Image, Languages, FileText } from 'lucide-react'; +import { MessageSquare, Settings, Image, Languages, FolderClosed } from 'lucide-react'; interface SidebarProps { activePage: string; @@ -85,7 +85,7 @@ export const Sidebar: React.FC = ({ onClick={() => onChangePage('files')} aria-label="File Management" > - + diff --git a/src/components/pages/FileManagementPage.tsx b/src/components/pages/FileManagementPage.tsx index 0de22b9..ae306a0 100644 --- a/src/components/pages/FileManagementPage.tsx +++ b/src/components/pages/FileManagementPage.tsx @@ -281,38 +281,38 @@ export const FileManagementPage = () => { }; // Open file -// const handleOpenFile = async (file: FileData) => { -// try { -// // First save the file to a temporary location -// if (!window.electron || !window.electron.saveFile || !window.electron.openFile) { -// console.error("Electron API not available"); -// return; -// } + const handleOpenFile = async (file: FileData) => { + try { + // First save the file to a temporary location + if (!window.electron || !window.electron.saveFile || !window.electron.openFile) { + console.error("Electron API not available"); + return; + } -// // Save file to temp location and then open it -// const saveResult = await window.electron.saveFile( -// file.data, -// file.name, -// file.type || 'application/octet-stream' -// ); + // Save file to temp location and then open it + const saveResult = await window.electron.saveFile( + file.data, + file.name, + file.type || 'application/octet-stream' + ); -// if (!saveResult.success || !saveResult.filePath) { -// if (!saveResult.canceled) { -// console.error("Error saving file:", saveResult.error); -// } -// return; -// } + if (!saveResult.success || !saveResult.filePath) { + if (!saveResult.canceled) { + console.error("Error saving file:", saveResult.error); + } + return; + } -// // Now open the file with the default application -// const openResult = await window.electron.openFile(saveResult.filePath); + // Now open the file with the default application + const openResult = await window.electron.openFile(saveResult.filePath); -// if (!openResult.success) { -// console.error("Error opening file:", openResult.error); -// } -// } catch (error) { -// console.error("Error opening file:", error); -// } -// }; + if (!openResult.success) { + console.error("Error opening file:", openResult.error); + } + } catch (error) { + console.error("Error opening file:", error); + } + }; // Format file size const formatFileSize = (bytes: number): string => { @@ -672,13 +672,13 @@ export const FileManagementPage = () => {
- {/* */} +