'use client';
import type { ReactNode } from 'react';
import { CustomerLayout } from '@/layout';
import { RoleGuard } from '@/components/auth';
import { APP_ROLES } from '@/constants';

/*
 * Customer (family) route group — the primary mobile-first experience with the
 * 5-tab bottom nav. A route group `(customer)` adds chrome without adding a URL
 * segment, so these screens live at the app root (/, /bookings, /patients, …).
 * RoleGuard gates it on a resolved customer role: a pure nurse lands on /nurse,
 * a role-less user on /select-role — never the family app as a loading stand-in.
 */
export default function CustomerRouteLayout({ children }: { children: ReactNode }) {
  return (
    <RoleGuard expected={APP_ROLES.CUSTOMER}>
      <CustomerLayout>{children}</CustomerLayout>
    </RoleGuard>
  );
}
