-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.tsx
43 lines (40 loc) · 1.08 KB
/
main.tsx
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
import { Suspense } from "npm/react";
import { Link, Outlet } from "npm/react-router-dom";
import { Helmet } from "npm/react-helmet-async";
import {
AppErrorBoundary,
DefaultErrorFallback,
} from "x/udibo_react_app/mod.tsx";
import { Loading } from "../components/loading.tsx";
const navLinks = [
{ label: "Home", to: "/" },
{ label: "About", to: "/about" },
{ label: "Blog", to: "/blog" },
{ label: "Fake", to: "/fake" },
];
export default function Main() {
return (
<>
<Helmet
defaultTitle="Example"
titleTemplate="Example | %s"
htmlAttributes={{ lang: "en" }}
>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</Helmet>
<ul>
{navLinks.map((link) => (
<li key={link.label}>
<Link to={link.to}>{link.label}</Link>
</li>
))}
</ul>
<Suspense fallback={<Loading />}>
<AppErrorBoundary FallbackComponent={DefaultErrorFallback}>
<Outlet />
</AppErrorBoundary>
</Suspense>
</>
);
}