-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathApp.tsx
More file actions
115 lines (104 loc) · 3.43 KB
/
App.tsx
File metadata and controls
115 lines (104 loc) · 3.43 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import React from 'react';
import { useAppLogic } from './hooks/useAppLogic';
import { useDarkMode } from './hooks/useDarkMode';
import ErrorBoundary from './components/ErrorBoundary';
import SettingsModal from './SettingsModal';
import Header from './components/Header';
import ChatInput from './components/InputSection';
import Sidebar from './components/Sidebar';
import ChatArea from './components/ChatArea';
const App = () => {
const {
sessions,
currentSessionId,
messages,
query,
setQuery,
selectedModel,
setSelectedModel,
config,
setConfig,
effectiveConfig,
isSidebarOpen,
setIsSidebarOpen,
isSettingsOpen,
setIsSettingsOpen,
appState,
managerAnalysis,
experts,
finalOutput,
processStartTime,
processEndTime,
handleRun,
handleNewChat,
handleSelectSession,
handleDeleteSession,
stopDeepThink,
focusTrigger,
handleSetThinkingLevel,
handleSetRecursiveLoop,
} = useAppLogic();
const { isDark, toggle: toggleDark } = useDarkMode();
return (
<ErrorBoundary>
<div className="flex flex-col h-screen bg-white dark:bg-slate-950 text-slate-800 dark:text-slate-200 font-sans selection:bg-blue-100 selection:text-blue-900 dark:selection:bg-blue-900 dark:selection:text-blue-100">
<SettingsModal
isOpen={isSettingsOpen}
onClose={() => setIsSettingsOpen(false)}
config={config}
setConfig={setConfig}
effectiveConfig={effectiveConfig}
model={selectedModel}
onSetThinkingLevel={handleSetThinkingLevel}
onSetRecursiveLoop={handleSetRecursiveLoop}
/>
<Header
selectedModel={selectedModel}
setSelectedModel={setSelectedModel}
onOpenSettings={() => setIsSettingsOpen(true)}
onToggleSidebar={() => setIsSidebarOpen(!isSidebarOpen)}
onNewChat={handleNewChat}
config={config}
isDark={isDark}
onToggleDark={toggleDark}
/>
<div className="flex flex-1 overflow-hidden relative">
<Sidebar
isOpen={isSidebarOpen}
onClose={() => setIsSidebarOpen(false)}
sessions={sessions}
currentSessionId={currentSessionId}
onSelectSession={handleSelectSession}
onNewChat={handleNewChat}
onDeleteSession={handleDeleteSession}
/>
<main className="flex-1 flex flex-col min-w-0 bg-white dark:bg-slate-950 relative">
<ChatArea
messages={messages}
appState={appState}
managerAnalysis={managerAnalysis}
experts={experts}
finalOutput={finalOutput}
processStartTime={processStartTime}
processEndTime={processEndTime}
onSuggestionClick={(text) => { setQuery(text); }}
/>
<div className="absolute bottom-0 left-0 right-0 z-20 pointer-events-none p-4 pb-6 flex justify-center bg-gradient-to-t from-white dark:from-slate-950 via-white/80 dark:via-slate-950/80 to-transparent">
<div className="pointer-events-auto w-full max-w-4xl">
<ChatInput
query={query}
setQuery={setQuery}
onRun={handleRun}
onStop={stopDeepThink}
appState={appState}
focusTrigger={focusTrigger}
/>
</div>
</div>
</main>
</div>
</div>
</ErrorBoundary>
);
};
export default App;