import type { Metadata } from "next"; import "./globals.css"; import { getServerConfig } from "@/lib/config"; import { Providers } from "@/components/Providers"; export const metadata: Metadata = { title: "LynkedUp Pro — Messages", description: "Slack-grade team messaging, inbox and support — a demo of the @lynkd/messaging-inbox-sdk.", }; // Runs before paint: restores the user's saved scheme + accent so returning // users never see a flash of the wrong theme. const NO_FLASH = ` try { var s = localStorage.getItem('lynkd.scheme'); if (s === 'dark') document.documentElement.classList.add('dark'); else if (s === 'light') document.documentElement.classList.remove('dark'); document.documentElement.style.colorScheme = document.documentElement.classList.contains('dark') ? 'dark' : 'light'; var t = localStorage.getItem('lynkd.theme'); if (t) { var p = JSON.parse(t); if (p && p.dark && p.dark.accent) { document.documentElement.style.setProperty('--c-accent', p.dark.accent); } } } catch (e) {} `; export default function RootLayout({ children }: { children: React.ReactNode }) { const config = getServerConfig(); const initialScheme = config.theme.mode === "light" ? "light" : "dark"; return (
{/* eslint-disable-next-line @next/next/no-before-interactive-script-outside-document */}