import{_ as v}from"./Paginate-BZTS8QtF.js";import{_ as g}from"./FilterDropdown-HyKaUaTA.js";import{_ as x}from"./NoDataFound-BCWTwO3P.js";import{d as C,s as M,r as p,c as a,o as n,b as l,a as s,e as f,t,F as u,g as N,n as $,w as m,h as r,u as b}from"./app-Do7K7VDV.js";import{_ as B}from"./UserLayout-B1erUghk.js";import"./SpinnerBtn-C-rqKjUt.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./InputFieldError-0BmYlL24.js";import"./ToastrContainer-CtYDvNPN.js";const L={class:"table-responsive mt-4 w-full"},T={class:"table"},j={class:"!text-right"},A={key:0,class:"tbody"},D={key:1},I={class:"flex justify-end"},O={class:"dropdown","data-placement":"bottom-start"},V={class:"dropdown-toggle"},E={class:"dropdown-content w-56"},F={class:"dropdown-list"},z={class:"dropdown-list-item"},R={class:"dropdown-list-item"},S={class:"dropdown-list-item"},q=["onClick"],G={key:1,class:"dropdown-list-item"},H=["onClick"],J={class:"w-full"},K=C({layout:B}),ns=Object.assign(K,{__name:"Index",props:["workspaces"],setup(d){const{deleteRow:_}=M(),w=[{label:"Name",value:"name"}];return(e,P)=>{const c=p("Link"),i=p("Icon");return n(),a(u,null,[l(g,{options:w}),s("div",L,[s("table",T,[s("thead",null,[s("tr",null,[s("th",null,t(e.trans("Name")),1),s("th",null,t(e.trans("Authority")),1),s("th",null,t(e.trans("Description")),1),s("th",null,t(e.trans("Modules")),1),s("th",null,t(e.trans("Total Members")),1),s("th",j,t(e.trans("Action")),1)])]),d.workspaces.data.length?(n(),a("tbody",A,[(n(!0),a(u,null,N(d.workspaces.data,(o,k)=>{var h;return n(),a("tr",{key:k},[s("td",null,t(o.name),1),s("td",null,[s("div",{class:$(["badge",o.is_owner?"badge-primary":"badge-secondary"])},t(o.is_owner?"Owner":"Member"),3)]),s("td",null,t(o.description||"N/A"),1),s("td",null,t((h=o.modules)==null?void 0:h.join(", ")),1),s("td",null,[o.is_owner?(n(),f(c,{key:0,href:e.route("user.workspaces.show",o)},{default:m(()=>[r(t(o.members_count??0)+" "+t(e.trans("Members")),1)]),_:2},1032,["href"])):(n(),a("span",D,t(o.members_count??0)+" "+t(e.trans("Members")),1))]),s("td",null,[s("div",I,[s("div",O,[s("div",V,[l(i,{class:"h-5 text-3xl text-slate-400",icon:"bx:dots-vertical-rounded"})]),s("div",E,[s("ul",F,[o.is_owner?(n(),a(u,{key:0},[s("li",z,[l(c,{class:"dropdown-link",href:e.route("user.workspaces.show",o.id)},{default:m(()=>[l(i,{class:"h-5 text-3xl text-slate-400",icon:"bxs:user-detail"}),r(" "+t(e.trans("Manage Team")),1)]),_:2},1032,["href"])]),s("li",R,[l(c,{class:"dropdown-link",href:e.route("user.workspaces.edit",o.id)},{default:m(()=>[l(i,{class:"h-5 text-3xl text-slate-400",icon:"bx:edit"}),r(" "+t(e.trans("Edit")),1)]),_:2},1032,["href"])]),s("li",S,[s("a",{class:"dropdown-link",onClick:y=>b(_)(e.route("user.workspaces.destroy",o.id))},[l(i,{class:"h-5 text-3xl text-slate-400",icon:"bx:trash"}),r(" "+t(e.trans("Delete")),1)],8,q)])],64)):(n(),a("li",G,[s("a",{class:"dropdown-link",onClick:y=>b(_)(e.route("user.workspaces.leave",o.id))},[l(i,{class:"h-5 text-3xl text-slate-400",icon:"bx:log-out"}),r(" "+t(e.trans("Leave")),1)],8,H)]))])])])])])])}),128))])):(n(),f(x,{key:1,forTable:!0}))]),s("div",J,[l(v,{links:d.workspaces.links},null,8,["links"])])])],64)}}});export{ns as default};
