asi-calculator/app/layout.tsx
Matthias Kretschmann dd44cc864e
market data refactor, add 24h price change (#8)
* new prices data structure

* market data refactor, add 24h price change

* browser language detection with middleware

* middleware tweaks
2024-04-09 13:46:15 +01:00

38 lines
926 B
TypeScript

import type { Metadata } from 'next'
import '@/styles/globals.css'
import '@/styles/loading-ui.css'
import Script from 'next/script'
import { title, description, font, liveUrl, isProduction } from '@/constants'
import { headers } from 'next/headers'
export const metadata: Metadata = {
title,
description,
alternates: { canonical: liveUrl },
metadataBase: new URL(liveUrl)
}
export default function RootLayout({
children
}: Readonly<{
children: React.ReactNode
}>) {
const headersList = headers()
const locale = headersList.get('x-locale')
return (
<html lang="en" data-locale={locale}>
<head>
{isProduction ? (
<Script
async
src="https://a.kretschmann.io/script.js"
data-website-id="6565eff1-a1c8-4b3e-a6c4-08ecb00b06ab"
/>
) : null}
</head>
<body className={font.variable}>{children}</body>
</html>
)
}