import{d as _,eA as w,G as h,b as k,c as C,w as c,f as d,u as O}from"./outputWidgets.f8f8676d.js";import{e as x,b as I}from"./icons.c3170cf4.js";import{a as v}from"./asyncComputed.9c91cdf6.js";import"./router.b4a342b4.js";import{O as l}from"./organization.f01d64b4.js";import"./columns.dbb1c1df.js";import{_ as A}from"./Navbar.vue_vue_type_script_setup_true_lang.629f3f60.js";import{C as D}from"./CrudView.fe3c74bf.js";import{B}from"./BaseLayout.f7927f02.js";import{a as N}from"./ant-design.8ffd5ed0.js";import"./Form.2b1bb5d1.js";import"./Title.53d37289.js";import"./transButton.ca7603a2.js";import"./Text.7ab5366c.js";import"./index.878fa14a.js";import"./gateway.209624eb.js";import"./activeRecord.913921b5.js";import"./pubsub.8eddc628.js";import"./index.cf4c23b9.js";import"./logo.084e5d7c.js";import"./index.44b02920.js";import"./url.46c79102.js";import"./index.4c4e9bdd.js";import"./index.97771f01.js";import"./index.2ab0079e.js";import"./index.e041bc2d.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]="db8ea9f5-d93b-419a-80ac-902ddbfc1767",o._sentryDebugIdIdentifier="sentry-dbid-db8ea9f5-d93b-419a-80ac-902ddbfc1767")}catch{}})();const nt=_({__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:t})=>{p.push({name:"organization",params:{organizationId:t}})},g=async t=>{const a=await l.create(t.name);s({key:a.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()),f())},y=h(()=>{var t,a;return{columns:[{name:"Organization Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(a=(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?a:[]}});return(t,a)=>(k(),C(B,null,{navbar:c(()=>[d(A,{breadcrumb:n})]),content:c(()=>[d(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:g},null,8,["loading","table"])]),_:1}))}});export{nt as default};
//# sourceMappingURL=Organizations.3e186e83.js.map
