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