import{d as _,ez as w,J as h,b as k,c as O,w as d,f as c,u as C}from"./outputWidgets.b9aa154a.js";import{e as x,b as I}from"./icons.4ed83c58.js";import{a as v}from"./asyncComputed.9bda3979.js";import"./console.ee73e2aa.js";import{O as p}from"./organization.b0d8127b.js";import"./index.4d631048.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.905048c8.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.8866a12f.js";import{B}from"./BaseLayout.ddf81c1c.js";import{a as N}from"./ant-design.a6411a07.js";import"./index.ade1bec6.js";import"./Form.55f226f4.js";import"./Title.6cd833fd.js";import"./index.74d4e484.js";import"./index.6b140cad.js";import"./index.29aa7167.js";import"./dayjs.d2a09bae.js";import"./index.ea68e603.js";import"./index.bb85a084.js";import"./TabPane.3d00468a.js";import"./index.ab1855db.js";import"./index.14f3ef13.js";import"./index.eb23b22d.js";import"./index.45ef6041.js";import"./index.45ac8fb9.js";import"./index.004b987c.js";import"./index.23063916.js";import"./index.55488473.js";import"./gateway.5aa82c5f.js";import"./activeRecord.8939db5d.js";import"./pubsub.967f482a.js";import"./logo.084e5d7c.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},i=new Error().stack;i&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[i]="037db85f-dd63-47e1-81d4-bb570dc262d2",a._sentryDebugIdIdentifier="sentry-dbid-037db85f-dd63-47e1-81d4-bb570dc262d2")}catch{}})();const ct=_({__name:"Organizations",setup(a){const i=[{label:"My organizations",path:"/organizations"}],n=[{key:"name",label:"Organization Name"}],l=w(),{loading:u,result:r,refetch:f}=v(()=>p.list()),s=({key:t})=>{l.push({name:"organization",params:{organizationId:t}})},g=async t=>{const e=await p.create(t.name);s({key:e.id})},b=async({key:t})=>{var o,m;await N("Are you sure you want to delete this organization?")&&(await((m=(o=r.value)==null?void 0:o.find(z=>z.id===t))==null?void 0:m.delete()),f())},y=h(()=>{var t,e;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(e=(t=r.value)==null?void 0:t.map(o=>({key:o.id,cells:[{text:o.name,link:`/organizations/${encodeURIComponent(o.id)}`},{text:o.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),O(B,null,{navbar:d(()=>[c(D,{breadcrumb:i})]),content:d(()=>[c(A,{"entity-name":"organization",loading:C(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:n,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{ct as default};
//# sourceMappingURL=Organizations.e2e1ec40.js.map
