import{j as $,b9 as k,bq as d,B as M,dq as y,D as e,aw as l,K as i,o as C,an as v,dr as S,ds as B,dt as o,R as g,du as u,dv as D,dw as n,bt as h,r as F,ah as R}from"./index-CNZMR1GT.js";import{b as q}from"./useTitle-BClow7LS.js";import{D as x}from"./DeletePopover-D42apEN8.js";import{W as H}from"./Wether-DITzMbFL.js";const K=()=>{const r=C();q("manage.sidemenu.metas");const{to:c}=$(),[p,m]=k(()=>d.get("/admin/meta/list")),[b,f]=M([]),a=async()=>{const t=await m();h(t,s=>f(s.content))};a();const[w,T]=y(t=>d.post("/admin/meta/delete?id=".concat(t)));return e(R,{spacing:"$2",alignItems:"start",w:"$full",get children(){return[e(l,{spacing:"$2",get children(){return[e(i,{colorScheme:"accent",get loading(){return p()},onClick:a,get children(){return r("global.refresh")}}),e(i,{onClick:()=>{c("/@manage/metas/add")},get children(){return r("global.add")}})]}}),e(v,{w:"$full",overflowX:"auto",get children(){return e(S,{highlightOnHover:!0,dense:!0,get children(){return[e(B,{get children(){return e(o,{get children(){return[e(g,{each:["path","password","write"],children:t=>e(u,{get children(){return r("metas.".concat(t))}})}),e(u,{get children(){return r("global.operations")}})]}})}}),e(D,{get children(){return e(g,{get each(){return b()},children:t=>e(o,{get children(){return[e(n,{get children(){return t.path}}),e(n,{get children(){return t.password}}),e(n,{get children(){return e(H,{get yes(){return t.write}})}}),e(n,{get children(){return e(l,{spacing:"$2",get children(){return[e(i,{onClick:()=>{c("/@manage/metas/edit/".concat(t.id))},get children(){return r("global.edit")}}),e(x,{get name(){return t.path},get loading(){return w()===t.id},onClick:async()=>{const s=await T(t.id);h(s,()=>{F.success(r("global.delete_success")),a()})}})]}})}})]}})})}})]}})}})]}})};export{K as default};
