import type { UserRole } from '@admin/types/auth'
import { requireRole } from '@admin/auth/middleware'

export async function RoleGate({
  roles,
  children
}: {
  roles: readonly UserRole[]
  children: React.ReactNode
}) {
  await requireRole(roles)

  return <>{children}</>
}
