import{d as _,eA as w,G as C,b as h,c as k,w as c,f as l,u as O}from"./outputWidgets.31ce2d5c.js";import{v as x,C as I}from"./icons.266b547d.js";import{a as v}from"./asyncComputed.7e3e21f4.js";import"./router.8f071dc2.js";import"./index.e05c62e3.js";import{O as p}from"./organization.e24bfce8.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.875539f3.js";import{C as D}from"./CrudView.9d67f588.js";import{B}from"./BaseLayout.bada4c41.js";import{a as N}from"./ant-design.feb03817.js";import"./FormItem.5f0b61bf.js";import"./hasIn.932773c2.js";import"./index.0d76378d.js";import"./index.cf4c23b9.js";import"./record.b2148451.js";import"./pubsub.2d9ab3f4.js";import"./gateway.3615e807.js";import"./logo.084e5d7c.js";import"./Text.46c5bec2.js";import"./Base.eeda2dae.js";import"./index.cad5b763.js";import"./Form.482980d3.js";import"./Modal.32a7843c.js";import"./url.94a5ee71.js";import"./index.627ab86d.js";import"./index.ef6e34b6.js";import"./Title.951eccc5.js";import"./index.5765ee72.js";import"./index.f1d2e592.js";import"./index.7e964756.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[n]="64fe59e5-be96-43b6-9a48-0be483290528",a._sentryDebugIdIdentifier="sentry-dbid-64fe59e5-be96-43b6-9a48-0be483290528")}catch{}})();const mt=_({__name:"Organizations",setup(a){const n=[{label:"My organizations",path:"/organizations"}],i=[{key:"name",label:"Organization Name"}],d=w(),{loading:u,result:r,refetch:g}=v(()=>p.list()),s=({key:t})=>{d.push({name:"organization",params:{organizationId:t}})},f=async t=>{const o=await p.create(t.name);s({key:o.id})},b=async({key:t})=>{var e,m;await N("Are you sure you want to delete this organization?")&&(await((m=(e=r.value)==null?void 0:e.find(z=>z.id===t))==null?void 0:m.delete()),g())},y=C(()=>{var t,o;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(t=r.value)==null?void 0:t.map(e=>({key:e.id,cells:[{text:e.name,link:`/organizations/${encodeURIComponent(e.id)}`},{text:e.id},{text:"",actions:[{icon:x,label:"Edit Organization",onClick:s},{icon:I,label:"Delete",onClick:b,dangerous:!0}]}]})))!=null?o:[]}});return(t,o)=>(h(),k(B,null,{navbar:c(()=>[l(A,{breadcrumb:n})]),content:c(()=>[l(D,{"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:f},null,8,["loading","table"])]),_:1}))}});export{mt as default};
//# sourceMappingURL=Organizations.5be44946.js.map
