import{k as e,b7 as t,bq as r,X as n,dv as a,E as s,ao as i,a8 as l,q as d,ae as c,dw as o,dx as g,dy as u,G as h,dz as m,dA as p,dB as f,bt as w,x as b,a7 as $}from"./index-C-dDkA_D.js";import{b as k}from"./useTitle-Dwsro-_9.js";import{D as j}from"./DeletePopover-Dp7l6lur.js";import{W as v}from"./Wether-CKVTyf1f.js";const x=()=>{const x=d();k("manage.sidemenu.metas");const{to:y}=e(),[C,q]=t(()=>r.get("/admin/meta/list")),[D,W]=n([]),X=async()=>{const e=await q();w(e,e=>W(e.content))};X();const[z,A]=a(e=>r.post(`/admin/meta/delete?id=${e}`));return s($,{spacing:"$2",alignItems:"start",w:"$full",get children(){return[s(i,{spacing:"$2",get children(){return[s(l,{colorScheme:"accent",get loading(){return C()},onClick:X,get children(){return x("global.refresh")}}),s(l,{onClick:()=>{y("/@manage/metas/add")},get children(){return x("global.add")}})]}}),s(c,{w:"$full",overflowX:"auto",get children(){return s(o,{highlightOnHover:!0,dense:!0,get children(){return[s(g,{get children(){return s(u,{get children(){return[s(h,{each:["path","password","write"],children:e=>s(m,{get children(){return x(`metas.${e}`)}})}),s(m,{get children(){return x("global.operations")}})]}})}}),s(p,{get children(){return s(h,{get each(){return D()},children:e=>s(u,{get children(){return[s(f,{get children(){return e.path}}),s(f,{get children(){return e.password}}),s(f,{get children(){return s(v,{get yes(){return e.write}})}}),s(f,{get children(){return s(i,{spacing:"$2",get children(){return[s(l,{onClick:()=>{y(`/@manage/metas/edit/${e.id}`)},get children(){return x("global.edit")}}),s(j,{get name(){return e.path},get loading(){return z()===e.id},onClick:async()=>{const t=await A(e.id);w(t,()=>{b.success(x("global.delete_success")),X()})}})]}})}})]}})})}})]}})}})]}})};export{x as default};
