Files
dyolink/frontend/src/app/layout.tsx

33 lines
1.0 KiB
TypeScript

// src/app/layout.tsx
import type { Metadata } from 'next';
import Script from 'next/script';
import '@/styles/globals.css';
import '@/styles/background-web.css';
import { AuthProvider } from '@/lib/hooks/useAuth';
import { THEME_STORAGE_KEY } from '@/lib/theme';
export const metadata: Metadata = {
title: 'DyoLink - Dental Clinic & Lab Communication Hub',
description: 'Connect dental clinics and laboratories seamlessly',
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const themeInit = `(function(){try{var k=${JSON.stringify(THEME_STORAGE_KEY)};var t=localStorage.getItem(k);document.documentElement.setAttribute('data-theme',t==='light'||t==='dark'?t:'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();`;
return (
<html lang="en" suppressHydrationWarning>
<body>
<Script id="theme-init" strategy="beforeInteractive">
{themeInit}
</Script>
<AuthProvider>
{children}
</AuthProvider>
</body>
</html>
);
}