| 1 | import Link from "next/link"; |
| 2 | import "./globals.css"; |
| 3 | |
| 4 | export const metadata = { |
| 5 | title: "vinext on Cloudflare", |
| 6 | }; |
| 7 | |
| 8 | const pageLinks = [ |
| 9 | ["/", "Home"], |
| 10 | ["/static", "Static"], |
| 11 | ["/isr", "Cached"], |
| 12 | ["/use-cache", "use cache"], |
| 13 | ["/notes", "Notes"], |
| 14 | ] as const; |
| 15 | |
| 16 | export default function RootLayout({ |
| 17 | children, |
| 18 | }: { |
| 19 | children: React.ReactNode; |
| 20 | }) { |
| 21 | return ( |
| 22 | <html lang="en"> |
| 23 | <body className="bg-slate-50 p-8 text-slate-900"> |
| 24 | <nav className="mb-8 flex flex-wrap gap-x-4 gap-y-2 text-sm"> |
| 25 | {pageLinks.map(([href, label]) => ( |
| 26 | <Link key={href} className="underline" href={href}> |
| 27 | {label} |
| 28 | </Link> |
| 29 | ))} |
| 30 | </nav> |
| 31 | {children} |
| 32 | </body> |
| 33 | </html> |
| 34 | ); |
| 35 | } |