PageSourceSearch

https://incommand.ai/assets/RoleProtectedRoute-C5FZ60D4.js

js incommand.ai collected 2026-10-05 15:00:41 UTC 1,495 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-radix-BnNg3BH5.js";import{u as o}from"./useUserRole-DhLGHMgy.js";import{L as n,B as c}from"./index-Epr9psQo.js";import{u as l}from"./vendor-react-67mgcWXU.js";import{S as m}from"./shield-alert-BXGylg4Q.js";import"./vendor-supabase-CTlrDMdV.js";import"./vendor-charts-Dck3qfzI.js";import"./vendor-query-PMAhJHCS.js";import"./vendor-motion-CSzk-Fqg.js";function b({children:s,allowedRoles:t,fallbackPath:d="/dashboard"}){const{role:r,loading:i,hasAnyRole:a}=o();return l(),i?e.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4",children:[e.jsx(n,{className:"h-8 w-8 animate-spin text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking permissions..."})]})}):!r||!a(t)?e.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:e.jsxs("div",{className:"flex flex-col items-center gap-4 text-center max-w-md",children:[e.jsx("div",{className:"rounded-full bg-destructive/10 p-4",children:e.jsx(m,{className:"h-8 w-8 text-destructive"})}),e.jsx("h2",{className:"text-xl font-semibold",children:"Access Denied"}),e.jsx("p",{className:"text-muted-foreground",children:"You don't have permission to access this page. Please contact an administrator if you believe this is an error."}),e.jsx(c,{onClick:()=>window.history.back(),variant:"outline",children:"Go Back"})]})}):e.jsx(e.Fragment,{children:s})}export{b as RoleProtectedRoute};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.