import type { Metadata } from "next";
import { detectLanguage } from "@/i18n";
import ThemeRegistry from "@/theme/ThemeRegistry";

export const metadata: Metadata = {
  title: "TSMS",
  description: "TSMS - Timesheet Management System",
};

export default async function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  const lang = await detectLanguage();

  return (
    <html lang={lang}>
      <body>
        <ThemeRegistry lang={lang}>{children}</ThemeRegistry>
      </body>
    </html>
  );
}
