import type { Metadata } from 'next';
import { ClerkProvider } from '@clerk/nextjs';
import './globals.css';

// ClerkProvider needs the publishableKey at runtime. Forcing the root
// layout to dynamic prevents Next from trying to SSG pages that touch
// Clerk (including the auto-generated _not-found page).
// SaaS templates are SSR-heavy anyway — no real loss in static optimization.
export const dynamic = 'force-dynamic';

export const metadata: Metadata = {
  title: '{{project_name}}',
  description: '{{description}}',
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <ClerkProvider>
      <html lang="en">
        <body className="min-h-screen bg-white text-neutral-900 antialiased">
          {children}
        </body>
      </html>
    </ClerkProvider>
  );
}
