import{d as _,ez as w,J as h,b as k,c as O,w as c,f as d,u as C}from"./outputWidgets.b13a87c2.js";import{e as x,b as I}from"./icons.76c1fe8b.js";import{a as v}from"./asyncComputed.02afd50e.js";import"./console.d76c010c.js";import{O as p}from"./organization.2e5c7a70.js";import"./index.b8915c7f.js";import{_ as D}from"./Navbar.vue_vue_type_script_setup_true_lang.7bd6f741.js";import{_ as A}from"./CrudView.vue_vue_type_script_setup_true_lang.cf244ae9.js";import{B}from"./BaseLayout.a36af3c6.js";import{a as N}from"./ant-design.b9e555b3.js";import"./index.98e61e8e.js";import"./Form.e21e0d73.js";import"./Title.6f86755a.js";import"./index.3d7f8177.js";import"./index.55a2786b.js";import"./index.c4d59e95.js";import"./dayjs.2e90d17d.js";import"./index.fbf04eaa.js";import"./index.7011a200.js";import"./TabPane.3cb0210e.js";import"./index.0345671f.js";import"./index.24360d49.js";import"./index.c32ce6af.js";import"./index.73746068.js";import"./index.7dcc157a.js";import"./index.0b99f8ef.js";import"./index.1b5bc05c.js";import"./index.957937c4.js";import"./gateway.f581ef9f.js";import"./activeRecord.f5a2d19d.js";import"./pubsub.dab46576.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]="ce867ff5-7437-4959-9079-0f15eebd05d3",a._sentryDebugIdIdentifier="sentry-dbid-ce867ff5-7437-4959-9079-0f15eebd05d3")}catch{}})();const dt=_({__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})},y=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())},b=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:y,dangerous:!0}]}]})))!=null?e:[]}});return(t,e)=>(k(),O(B,null,{navbar:c(()=>[d(D,{breadcrumb:i})]),content:c(()=>[d(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:b.value,fields:n,onCreate:g},null,8,["loading","table"])]),_:1}))}});export{dt as default};
//# sourceMappingURL=Organizations.88a7261f.js.map
