37 lines
850 B
JavaScript
37 lines
850 B
JavaScript
import Header from '~/app/components/header'
|
|
import Footer from '~/app/components/footer'
|
|
import { Providers } from '~/app/providers'
|
|
import { Container } from '~/app/ui'
|
|
import directus from '~/lib/directus'
|
|
|
|
async function getGlobals() {
|
|
return directus.items('globals').readOne(process.env.GLOBALS_ID)
|
|
}
|
|
|
|
export async function generateMetadata() {
|
|
const globals = await getGlobals()
|
|
|
|
return {
|
|
title: globals.meta_title,
|
|
description: globals.meta_description,
|
|
}
|
|
}
|
|
|
|
export default async function RootLayout({ children }) {
|
|
const globals = await getGlobals()
|
|
|
|
return (
|
|
<html lang="en">
|
|
<body>
|
|
<Providers>
|
|
<Container maxW="3xl">
|
|
<Header siteName={globals.site_name} />
|
|
{children}
|
|
<Footer />
|
|
</Container>
|
|
</Providers>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|