mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-04 09:32:00 +00:00 
			
		
		
		
	* redo Settings modal UI * add python code interpreter * fix auto scroll * build * fix overflow for long output lines * bring back sticky copy button * adapt layout on mobile view * fix multiple lines output and color scheme * handle python exception * better state management * add webworker * add headers * format code * speed up by loading pyodide on page load * (small tweak) add small animation to make it feels like claude
		
			
				
	
	
		
			48 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.2 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';
 | 
						|
 | 
						|
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"
 | 
						|
        id="main-scroll"
 | 
						|
      >
 | 
						|
        <Header />
 | 
						|
        <Outlet />
 | 
						|
      </div>
 | 
						|
      {
 | 
						|
        <SettingDialog
 | 
						|
          show={showSettings}
 | 
						|
          onClose={() => setShowSettings(false)}
 | 
						|
        />
 | 
						|
      }
 | 
						|
    </>
 | 
						|
  );
 | 
						|
}
 | 
						|
 | 
						|
export default App;
 |