mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 00:35:50 +01:00
29 lines
657 B
TypeScript
29 lines
657 B
TypeScript
|
|
import { LocationProvider, Router, Route, hydrate, prerender as ssr } from 'preact-iso';
|
||
|
|
|
||
|
|
import { Header } from './components/Header.jsx';
|
||
|
|
import { Home } from './pages/Home/index.jsx';
|
||
|
|
import { NotFound } from './pages/_404.jsx';
|
||
|
|
import './style.css';
|
||
|
|
|
||
|
|
export function App() {
|
||
|
|
return (
|
||
|
|
<LocationProvider>
|
||
|
|
<Header />
|
||
|
|
<main>
|
||
|
|
<Router>
|
||
|
|
<Route path="/" component={Home} />
|
||
|
|
<Route default component={NotFound} />
|
||
|
|
</Router>
|
||
|
|
</main>
|
||
|
|
</LocationProvider>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (typeof window !== 'undefined') {
|
||
|
|
hydrate(<App />, document.getElementById('app'));
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function prerender(data) {
|
||
|
|
return await ssr(<App {...data} />);
|
||
|
|
}
|