mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 23:28:11 +00:00
49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import './globals.css';
|
|
import { Providers } from './providers';
|
|
import AppHeader from '@/components/AppHeader';
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'EDR Passenger Portal - Book Your Train Journey',
|
|
description: 'Book train tickets on the Ethio-Djibouti Railway',
|
|
};
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<body className="font-sans antialiased">
|
|
<script
|
|
dangerouslySetInnerHTML={{
|
|
__html: `
|
|
(function() {
|
|
try {
|
|
var theme = localStorage.getItem('theme');
|
|
var effectiveTheme = 'light';
|
|
|
|
if (theme === 'dark') {
|
|
effectiveTheme = 'dark';
|
|
} else if (theme === 'light') {
|
|
effectiveTheme = 'light';
|
|
} else if (theme === 'system' || !theme) {
|
|
effectiveTheme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
}
|
|
|
|
document.documentElement.classList.add(effectiveTheme);
|
|
} catch (e) {}
|
|
})();
|
|
`,
|
|
}}
|
|
/>
|
|
<Providers>
|
|
<AppHeader />
|
|
{children}
|
|
</Providers>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|