import{d as _,ez as w,J as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.ec044eb8.js";import{e as x,b as I}from"./icons.a554ebda.js";import{a as v}from"./asyncComputed.70e28ece.js";import"./router.8cea9830.js";import{O as l}from"./organization.97fde710.js";import"./index.ca493aff.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.77710e38.js";import{C as A}from"./CrudView.a07f1600.js";import{B}from"./BaseLayout.8ae9d39e.js";import{a as N}from"./ant-design.50ece8f6.js";import"./Title.85fa9137.js";import"./index.6e43b5b9.js";import"./gateway.8ffe4c25.js";import"./activeRecord.eb528dd4.js";import"./pubsub.33b79e26.js";import"./logo.084e5d7c.js";import"./index.cdce8068.js";import"./index.185a1704.js";import"./index.10d6c7c5.js";import"./Form.316ac787.js";import"./url.a1da359b.js";import"./index.67245513.js";import"./index.d97f12e1.js";import"./index.cd569242.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="eeb8bc4a-8dde-46eb-a87b-7c5ffbe145d9",o._sentryDebugIdIdentifier="sentry-dbid-eeb8bc4a-8dde-46eb-a87b-7c5ffbe145d9")}catch{}})();const ae=_({__name:"Organizations",setup(o){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],p=w(),{loading:u,result:r,refetch:f}=v(()=>l.list()),s=({key:e})=>{p.push({name:"organization",params:{organizationId:e}})},g=async e=>{const a=await l.create(e.name);s({key:a.id})},b=async({key:e})=>{var t,m;await N("Are you sure you want to delete this organization?")&&(await((m=(t=r.value)==null?void 0:t.find(z=>z.id===e))==null?void 0:m.delete()),f())},y=h(()=>{var e,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(e=r.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.name,link:`/organizations/${encodeURIComponent(t.id)}`},{text:t.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?a:[]}});return(e,a)=>(k(),C(B,null,{navbar:c(()=>[d(D,{breadcrumb:n})]),content:c(()=>[d(A,{"entity-name":"organization",loading:O(u),title:"My organizations",description:"An organization is your company\u2019s account. Add co-workers, manage their access, organize projects and billing.","create-button-text":"Create Organization","empty-title":"No organizations here yet",table:y.value,fields:i,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{ae as default};
//# sourceMappingURL=Organizations.89f7c95b.js.map
