import { headers } from 'next/headers';
import { createRouteGuard } from '@/lib/auth/createRouteGuard';

interface OnboardingLayoutProps {
  children: React.ReactNode;
}

/**
 * Onboarding Layout
 *
 * Provides authentication protection for the onboarding flow.
 * Uses RouteGuard to enforce access control server-side.
 */
export default async function OnboardingLayout({ children }: OnboardingLayoutProps) {
  const headerStore = await headers();
  const pathname = headerStore.get('x-pathname') || '/';
  
  const guard = createRouteGuard();
  await guard.enforce({ pathname });
  
  return (
    <div className="min-h-screen bg-deep-graphite">
      {children}
    </div>
  );
}