1
0
Fork 0

Use of Server Component for Navbar fetching

This commit is contained in:
Neshura 2023-06-10 16:09:47 +02:00
parent 5bd4f2aab3
commit c4aa0dc93c
Signed by: Neshura
GPG key ID: B6983AAA6B9A7A6C
2 changed files with 22 additions and 3 deletions

View file

@ -1,20 +1,23 @@
import './globals.css'
import { PageNavbar } from '@/components/navbar'
import * as fs from 'fs';
export const metadata = {
title: 'Stellaris Ethics Compass',
description: '',
}
export default function RootLayout({
export default async function RootLayout({
children,
}: {
children: React.ReactNode
}) {
const navLinks = JSON.parse(fs.readFileSync('public/routes_api.json', 'utf-8')).links;
return (
<html lang="en">
<body>
<PageNavbar />
<PageNavbar links={navLinks}/>
{children}
</body>
</html>