MCPcopy Create free account
hub / github.com/IQEngine/IQEngine / useRouter

Function useRouter

client/src/hooks/use-router.tsx:6–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4import { useProtectedRoute } from '@/auth/hooks/use-protected-route';
5
6export function useRouter() {
7 const router = createBrowserRouter([
8 {
9 path: '/',
10 async lazy() {
11 let { App } = await import('@/app');
12 return { Component: App };
13 },
14 children: [
15 {
16 path: 'about',
17 async lazy() {
18 let { LandingPage } = await import('@/pages/landing-page/landing-page');
19 return { Component: LandingPage };
20 },
21 },
22 {
23 path: 'sigmf',
24 async lazy() {
25 let { SigMF } = await import('@/pages/sigmf');
26 return { Component: SigMF };
27 },
28 },
29 {
30 path: 'query',
31 async lazy() {
32 let { MetadataQuery } = await import('@/pages/metadata-query/metadata-query');
33 return { Component: MetadataQuery };
34 },
35 },
36 {
37 path: 'smart-query',
38 async lazy() {
39 let { SmartQuery } = await import('@/pages/metadata-query/smart-query');
40 return { Component: SmartQuery };
41 },
42 },
43 {
44 path: 'upload',
45 async lazy() {
46 let { UploadPage } = await import('@/pages/upload-page');
47 return { Component: UploadPage };
48 },
49 },
50 {
51 path: 'docs',
52 async lazy() {
53 let { DocsPages } = await import('@/pages/docs/docs-pages');
54 return { Component: DocsPages };
55 },
56 },
57 // because there are so many docs pages, we have one component that takes in the page name as a param
58 {
59 path: 'docs/:page',
60 async lazy() {
61 let { DocsPages } = await import('@/pages/docs/docs-pages');
62 return { Component: DocsPages };
63 },

Callers 1

index.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected