Skip to content

Commit 7df3925

Browse files
committed
Function: Add File Management Page
1 parent 6c486a5 commit 7df3925

File tree

8 files changed

+674
-11
lines changed

8 files changed

+674
-11
lines changed

src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { useEffect, useState } from 'react';
22
import { ChatPage } from './components/pages/ChatPage';
33
import { ImageGenerationPage } from './components/pages/ImageGenerationPage';
44
import { TranslationPage } from './components/pages/TranslationPage';
5+
import { FileManagementPage } from './components/pages/FileManagementPage';
56
import MainLayout from './components/layout/MainLayout';
67
import DatabaseInitializer from './components/core/DatabaseInitializer';
78

@@ -36,6 +37,7 @@ function App() {
3637
{activePage === 'chat' && <ChatPage />}
3738
{activePage === 'image' && <ImageGenerationPage />}
3839
{activePage === 'translation' && <TranslationPage />}
40+
{activePage === 'files' && <FileManagementPage />}
3941
</MainLayout>
4042
</DatabaseInitializer>
4143
);

src/components/layout/Sidebar.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { MessageSquare, Settings, Image, Languages } from 'lucide-react';
2+
import { MessageSquare, Settings, Image, Languages, FileText } from 'lucide-react';
33

44
interface SidebarProps {
55
activePage: string;
@@ -28,6 +28,9 @@ export const Sidebar: React.FC<SidebarProps> = ({
2828
else if(activePage === 'translation'){
2929
return 'translation';
3030
}
31+
else if(activePage === 'files'){
32+
return 'files';
33+
}
3134

3235
return '';
3336
}
@@ -72,6 +75,18 @@ export const Sidebar: React.FC<SidebarProps> = ({
7275
>
7376
<Languages size={22} />
7477
</button>
78+
79+
<button
80+
className={`w-12 h-12 rounded-lg flex items-center justify-center transition-all duration-200 ${
81+
getActivePage() === 'files'
82+
? 'navigation-item-selected navigation-item-text'
83+
: 'navigation-item navigation-item-text'
84+
}`}
85+
onClick={() => onChangePage('files')}
86+
aria-label="File Management"
87+
>
88+
<FileText size={22} />
89+
</button>
7590
</div>
7691

7792
{/* Settings button at bottom */}

0 commit comments

Comments
 (0)