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

/*
 * Admin / backoffice route group (/admin/…) — desktop-oriented ops console (f15)
 * with a persistent sidebar. RoleGuard gates the shell on the (collapsed) admin actor
 * role; the per-console fine-grained gating stays with useAdminCapabilities inside.
 */
export default function AdminRouteLayout({ children }: { children: ReactNode }) {
  return (
    <RoleGuard expected={APP_ROLES.ADMIN}>
      <AdminLayout>{children}</AdminLayout>
    </RoleGuard>
  );
}
