PageSourceSearch

https://incommand.ai/assets/TenantRoleProtectedRoute-D_WOtZBj.js

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

1import{j as e}from"./vendor-radix-BnNg3BH5.js";import{b as m,L as d,B as x}from"./index-Epr9psQo.js";import{u}from"./useUserRole-DhLGHMgy.js";import{S as h}from"./shield-alert-BXGylg4Q.js";import"./vendor-react-67mgcWXU.js";import"./vendor-supabase-CTlrDMdV.js";import"./vendor-charts-Dck3qfzI.js";import"./vendor-query-PMAhJHCS.js";import"./vendor-motion-CSzk-Fqg.js";function A({children:t,allowedTenantRoles:n}){const{currentMembership:i,loading:r}=m(),{loading:o,hasAnyRole:a}=u();if(r||o)return 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(d,{className:"h-8 w-8 animate-spin text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Checking permissions..."})]})});const c=a(["admin","moderator"]),s=i?.role,l=s&&n.includes(s);return!c&&!l?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(h,{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. Only organization owners and admins can access settings."}),e.jsx(x,{onClick:()=>window.history.back(),variant:"outline",children:"Go Back"})]})}):e.jsx(e.Fragment,{children:t})}export{A as TenantRoleProtectedRoute};

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.