1import{j as e}from"./ui-vendor-Nh__yRYT.js";import{v as g,w as h,u as p,x as f,z as j,A as z,B as a,F as b,G as v}from"./index-BinsBWQu.js";import{u as N}from"./use-view-transition-navigate-OfoUcrvx.js";import"./react-vendor-NvA41F0Y.js";function w(){const{data:n}=g(),{data:i}=h.useActiveOrganization(),{updatePreferences:c}=p(),s=N(),d=f(),r=j(),l=z(),m=async t=>{const u=n?.find(x=>x.id===t),o={organizationId:t,organizationName:u?.name,tenantScopeActions:d,tenantScopeStore:r,queryClient:l,updatePreferences:c};if(r.getSnapshot().status==="ready"){await b(o);return}await v(o)};return e.jsxs("div",{className:"container mx-auto py-8",children:[e.jsx("h1",{className:"sr-only",children:"Organizations"}),e.jsx("div",{className:"mb-6 flex justify-end",children:e.jsx(a,{onClick:()=>s("/organizations/create"),children:"Create Organization"})}),e.jsxs("div",{className:"grid gap-4",children:[n?.map(t=>e.jsxs("div",{className:"flex items-center justify-between border border-cool-border bg-card p-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:t.name}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["/",t.slug]}),i?.id===t.id&&e.jsx("span",{className:"mt-2 inline-flex items-center border border-accent-strong bg-selector-surface px-2 py-1 text-xs font-medium text-accent-strong",children:"Active"})]}),i?.id!==t.id&&e.jsx(a,{variant:"outline",onClick:()=>m(t.id),children:"Switch to this organization"})]},t.id)),n?.length===0&&e.jsxs("div",{className:"border border-cool-border bg-field-muted py-12 text-center",children:[e.jsx("p",{className:"text-muted-foreground mb-4",children:"No organizations yet"}),e.jsx(a,{onClick:()=>s("/organizations/create"),children:"Create your first organization"})]})]})]})}export{w as OrganizationListPage};
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.