-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.tsx
More file actions
75 lines (68 loc) · 2.96 KB
/
App.tsx
File metadata and controls
75 lines (68 loc) · 2.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import React, { useState } from 'react';
import ChatView from './components/ChatView';
import ImageStudioView from './components/ImageStudioView';
import VideoStudioView from './components/VideoStudioView';
import AudioStudioView from './components/AudioStudioView';
import GamesView from './components/GamesView';
import { ChatIcon } from './components/icons/ChatIcon';
import { ImageIcon } from './components/icons/ImageIcon';
import { VideoIcon } from './components/icons/VideoIcon';
import { AudioIcon } from './components/icons/AudioIcon';
import { GameIcon } from './components/icons/GameIcon';
import { SparklesIcon } from './components/icons/SparklesIcon';
type Tab = 'chat' | 'image' | 'video' | 'audio' | 'games';
const App: React.FC = () => {
const [activeTab, setActiveTab] = useState<Tab>('chat');
const renderContent = () => {
switch (activeTab) {
case 'chat':
return <ChatView />;
case 'image':
return <ImageStudioView />;
case 'video':
return <VideoStudioView />;
case 'audio':
return <AudioStudioView />;
case 'games':
return <GamesView />;
default:
return <ChatView />;
}
};
const NavButton: React.FC<{ tabName: Tab; label: string; icon: React.ReactNode }> = ({ tabName, label, icon }) => (
<button
onClick={() => setActiveTab(tabName)}
className={`flex flex-col sm:flex-row items-center justify-center sm:justify-start gap-2 px-4 py-3 text-sm font-medium rounded-lg transition-all duration-200 ${
activeTab === tabName
? 'bg-purple-600 text-white shadow-lg'
: 'text-gray-300 hover:bg-gray-700 hover:text-white'
}`}
>
{icon}
<span className="hidden sm:inline">{label}</span>
</button>
);
return (
<div className="flex flex-col h-screen bg-gray-900 text-gray-100 font-sans">
<header className="flex items-center justify-between p-4 border-b border-gray-700 bg-gray-800/50 backdrop-blur-sm">
<div className="flex items-center gap-3">
<SparklesIcon className="w-8 h-8 text-purple-400" />
<h1 className="text-2xl font-bold tracking-tighter">DuskGPT AI</h1>
</div>
</header>
<div className="flex flex-1 overflow-hidden">
<nav className="flex flex-col gap-2 p-4 bg-gray-800/50 border-r border-gray-700">
<NavButton tabName="chat" label="Chat" icon={<ChatIcon className="w-5 h-5" />} />
<NavButton tabName="image" label="Image Studio" icon={<ImageIcon className="w-5 h-5" />} />
<NavButton tabName="video" label="Video Studio" icon={<VideoIcon className="w-5 h-5" />} />
<NavButton tabName="audio" label="Audio Studio" icon={<AudioIcon className="w-5 h-5" />} />
<NavButton tabName="games" label="Games" icon={<GameIcon className="w-5 h-5" />} />
</nav>
<main className="flex-1 overflow-y-auto p-4 md:p-6 lg:p-8">
{renderContent()}
</main>
</div>
</div>
);
};
export default App;