| 1 | /** @jsxImportSource react */ |
| 2 | import { Outlet } from "react-router"; |
| 3 | import "./app.css"; |
| 4 | |
| 5 | export function Layout({ children }: { children: React.ReactNode }) { |
| 6 | return ( |
| 7 | <html lang="en"> |
| 8 | <head> |
| 9 | <meta charSet="utf-8" /> |
| 10 | <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 11 | <title>React Router on Cloudflare</title> |
| 12 | </head> |
| 13 | <body className="bg-slate-50 p-8 text-slate-900">{children}</body> |
| 14 | </html> |
| 15 | ); |
| 16 | } |
| 17 | |
| 18 | export default function Component() { |
| 19 | return <Outlet />; |
| 20 | } |
| 21 | |
| 22 | export function ErrorBoundary({ error }: { error?: unknown }) { |
| 23 | return ( |
| 24 | <main> |
| 25 | <h1>Application error</h1> |
| 26 | <pre>{error instanceof Error ? error.message : String(error)}</pre> |
| 27 | </main> |
| 28 | ); |
| 29 | } |