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

/*
 * Partner-center portal route group (/partner/…) — a separate authz scope from /admin (f15). A center
 * admin sees only their own center; tenancy is server-enforced and each portal page resolves the caller's
 * own center via `useMyPartnerCenter` (a 403/404 renders the access-denied state). The RoleGuard here takes
 * no `expected` role — partner scope isn't an `AppRole`, so the guard only hardens `/me` hydration (neutral
 * loading/error instead of the raw shell); the center-resolution gate stays with `useMyPartnerCenter`.
 */
export default function PartnerRouteLayout({ children }: { children: ReactNode }) {
  return (
    <RoleGuard>
      <PartnerLayout>{children}</PartnerLayout>
    </RoleGuard>
  );
}
