import{k as e,b7 as t,bq as r,X as n,dz as a,E as s,ao as i,a8 as l,q as d,ae as c,dA as o,dB as g,dC as u,G as h,dD as m,dE as p,dF as f,bt as b,x as w,a7 as $}from"./index-WdfADTOW.js";import{b as k}from"./useTitle-BZYCQV-b.js";import{D as C}from"./DeletePopover-C4TPX-K0.js";import{W as j}from"./Wether-CvBrurPJ.js";const v=()=>{const v=d();k("manage.sidemenu.metas");const{to:x}=e(),[y,D]=t(()=>r.get("/admin/meta/list")),[q,E]=n([]),W=async()=>{const e=await D();b(e,e=>E(e.content))};W();const[X,z]=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 y()},onClick:W,get children(){return v("global.refresh")}}),s(l,{onClick:()=>{x("/@manage/metas/add")},get children(){return v("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 v(`metas.${e}`)}})}),s(m,{get children(){return v("global.operations")}})]}})}}),s(p,{get children(){return s(h,{get each(){return q()},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(j,{get yes(){return e.write}})}}),s(f,{get children(){return s(i,{spacing:"$2",get children(){return[s(l,{onClick:()=>{x(`/@manage/metas/edit/${e.id}`)},get children(){return v("global.edit")}}),s(C,{get name(){return e.path},get loading(){return X()===e.id},onClick:async()=>{const t=await z(e.id);b(t,()=>{w.success(v("global.delete_success")),W()})}})]}})}})]}})})}})]}})}})]}})};export{v as default};
