import type { Metadata } from "next";
import { Inter } from "next/font/google";

import { LocaleProvider } from "@/components/providers/locale-provider";
import { getCurrentLocale } from "@/lib/i18n-server";
import "./globals.css";

const inter = Inter({
  subsets: ["latin"],
  variable: "--font-body"
});

export const metadata: Metadata = {
  title: "AbelBirdnest Stock",
  description: "AbelBirdnest Stock untuk lot persediaan, biaya perolehan, dan ketertelusuran.",
  icons: {
    icon: "/favicon.ico"
  }
};

export default async function RootLayout({
  children
}: Readonly<{
  children: React.ReactNode;
}>) {
  const locale = await getCurrentLocale();

  return (
    <html lang={locale}>
      <body className={`${inter.variable} font-[var(--font-body)] antialiased`}>
        <LocaleProvider initialLocale={locale}>
          <div className="min-h-screen [font-feature-settings:'ss01'_1,'cv10'_1]">
            {children}
          </div>
        </LocaleProvider>
      </body>
    </html>
  );
}
