import{_ as x}from"./nuxt-link.40687dc5.js";import{f as D,P as E,E as T,B as k,U as N,T as g,y as P,z as B,D as b,_ as R,r as n,o as v,g as L,w as s,b as a,d as C,t as U,a as I}from"./entry.c7cd0af6.js";import{i as $}from"./utils.1db1ba01.js";const q=D({components:{BTable:E,EntityDelete:T,ClientList:k,UserEntity:N,Timeago:g},emits:["deleted"],setup(t,{emit:u}){const _=i=>{u("deleted",i)},l=P(),{realm:f,realmManagementId:p}=B(l),o={filter:{realm_id:[p.value,null]}},d=i=>$(f.value,i.realm_id),r=l.has(b.CLIENT_EDIT),c=l.has(b.CLIENT_DROP);return{fields:[{key:"id",label:"ID",thClass:"text-left",tdClass:"text-left"},{key:"name",label:"Name",thClass:"text-left",tdClass:"text-left"},{key:"user_id",label:"User",thClass:"text-center",tdClass:"text-center"},{key:"created_at",label:"Created at",thClass:"text-center",tdClass:"text-center"},{key:"updated_at",label:"Updated at",thClass:"text-left",tdClass:"text-left"},{key:"options",label:"",tdClass:"text-left"}],isResourceWritable:d,hasEditPermission:r,hasDropPermission:c,handleDeleted:_,query:o}}},"$7HJniSYcgC"),w=I("i",{class:"fa-solid fa-bars"},null,-1);function W(t,u,_,l,f,p){const o=n("Timeago"),d=n("UserEntity"),r=x,c=n("EntityDelete"),y=n("BTable"),i=n("ClientList");return v(),L(i,{"header-title":{icon:"fa-solid fa-list pe-1",content:"Overview"},query:t.query,onDeleted:t.handleDeleted},{body:s(m=>[a(y,{items:m.data,fields:t.fields,busy:m.busy,"head-variant":"'dark'",outlined:""},{"cell(created_at)":s(e=>[a(o,{datetime:e.item.created_at},null,8,["datetime"])]),"cell(updated_at)":s(e=>[a(o,{datetime:e.item.created_at},null,8,["datetime"])]),"cell(user_id)":s(e=>[a(d,{"entity-id":e.item.user_id},{default:s(h=>[C(U(h.entity.name),1)]),error:s(()=>[C(" - ")]),_:2},1032,["entity-id"])]),"cell(options)":s(e=>[a(r,{to:"/admin/clients/"+e.item.id,class:"btn btn-xs btn-outline-primary me-1",disabled:!t.hasEditPermission||!t.isResourceWritable(e.item)},{default:s(()=>[w]),_:2},1032,["to","disabled"]),a(c,{class:"btn btn-xs btn-outline-danger","entity-id":e.item.id,"entity-type":"client","with-text":!1,disabled:!t.hasDropPermission||!t.isResourceWritable(e.item),onDeleted:m.deleted},null,8,["entity-id","disabled","onDeleted"])]),_:2},1032,["items","fields","busy"])]),_:1},8,["query","onDeleted"])}const z=R(q,[["render",W]]);export{z as default};
