8c83449cb7
* rework the input area * process selected file * change all icons to heroicons * fix thought process collapse * move conversation more menu to sidebar * sun icon --> moon icon * rm default system message * stricter upload file check, only allow image if server has mtmd * build it * add renaming * better autoscroll * build * add conversation group * fix scroll * extra context first, then user input in the end * fix <hr> tag * clean up a bit * build * add mb-3 for <pre> * throttle adjustTextareaHeight to make it less laggy * (nits) missing padding in sidebar * rm stray console log
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { HashRouter, Outlet, Route, Routes } from 'react-router';
|
|
import Header from './components/Header';
|
|
import Sidebar from './components/Sidebar';
|
|
import { AppContextProvider, useAppContext } from './utils/app.context';
|
|
import ChatScreen from './components/ChatScreen';
|
|
import SettingDialog from './components/SettingDialog';
|
|
import { Toaster } from 'react-hot-toast';
|
|
|
|
function App() {
|
|
return (
|
|
<HashRouter>
|
|
<div className="flex flex-row drawer lg:drawer-open">
|
|
<AppContextProvider>
|
|
<Routes>
|
|
<Route element={<AppLayout />}>
|
|
<Route path="/chat/:convId" element={<ChatScreen />} />
|
|
<Route path="*" element={<ChatScreen />} />
|
|
</Route>
|
|
</Routes>
|
|
</AppContextProvider>
|
|
</div>
|
|
</HashRouter>
|
|
);
|
|
}
|
|
|
|
function AppLayout() {
|
|
const { showSettings, setShowSettings } = useAppContext();
|
|
return (
|
|
<>
|
|
<Sidebar />
|
|
<div
|
|
className="drawer-content grow flex flex-col h-screen w-screen mx-auto px-4 overflow-auto bg-base-100"
|
|
id="main-scroll"
|
|
>
|
|
<Header />
|
|
<Outlet />
|
|
</div>
|
|
{
|
|
<SettingDialog
|
|
show={showSettings}
|
|
onClose={() => setShowSettings(false)}
|
|
/>
|
|
}
|
|
<Toaster />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default App;
|