59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import { headers } from 'next/headers';
|
|
import { Inter } from 'next/font/google';
|
|
import { Suspense } from 'react';
|
|
import { getBaseUrl } from '@/lib/get-base-url';
|
|
import { Providers } from './Providers';
|
|
import '@umami/react-zen/styles.full.css';
|
|
import './global.css';
|
|
|
|
const inter = Inter({
|
|
subsets: ['latin'],
|
|
display: 'swap',
|
|
variable: '--font-inter',
|
|
});
|
|
|
|
export default function ({ children }) {
|
|
if (process.env.DISABLE_UI) {
|
|
return (
|
|
<html>
|
|
<body></body>
|
|
</html>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<html lang="en" className={`${inter.className} ${inter.variable}`}>
|
|
<head>
|
|
<link rel="icon" href="/favicon.ico" />
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
|
|
<link rel="manifest" href="/site.webmanifest" />
|
|
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
|
|
<meta name="msapplication-TileColor" content="#da532c" />
|
|
<meta name="theme-color" content="#fafafa" media="(prefers-color-scheme: light)" />
|
|
<meta name="theme-color" content="#2f2f2f" media="(prefers-color-scheme: dark)" />
|
|
<meta name="robots" content="noindex,nofollow" />
|
|
</head>
|
|
<body>
|
|
<Suspense>
|
|
<Providers>{children}</Providers>
|
|
</Suspense>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
const headerStore = await headers();
|
|
|
|
return {
|
|
metadataBase: getBaseUrl(headerStore),
|
|
title: {
|
|
template: '%s | Umami',
|
|
default: 'Umami',
|
|
},
|
|
};
|
|
}
|