import{c as m,r as n,bR as x,c4 as u,j as e,T as s,aF as c,B as p,c5 as f,bg as j,p as g,t as h,i as y,$ as N}from"./index-B2TpLIOm.js";import{A as b,a as C,b as v}from"./alert-CTyk4gGY.js";import{T as k}from"./textarea-TeCmazBR.js";import{L as A}from"./loader-circle-CQ-CZxGV.js";const L=m("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);function q(){const[t,l]=n.useState(""),[a,r]=n.useState(!1),o=a?A:f;async function d(){try{r(!0);const{config:i}=await g.send("/api/beszel/config-yaml",{});l(i)}catch(i){h({title:y._({id:"SlfejT"}),description:i.message,variant:"destructive"})}finally{r(!1)}}return x()||u(N,"settings",{name:"general"}),e.jsxs("div",{children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-xl font-medium mb-2",children:e.jsx(s,{id:"HqAFfq"})}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.jsx(s,{id:"fw839L"})})]}),e.jsx(c,{className:"my-4"}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed my-1",children:e.jsx(s,{id:"CLDb6E",components:{0:e.jsx("code",{className:"bg-muted rounded-sm px-1 text-primary"})}})}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:e.jsx(s,{id:"2FBOPo"})}),e.jsxs(b,{className:"my-4 border-destructive text-destructive w-auto table md:pe-6",children:[e.jsx(L,{className:"size-4.5 stroke-destructive"}),e.jsx(C,{children:e.jsx(s,{id:"sN0FOL"})}),e.jsx(v,{children:e.jsx("p",{children:e.jsx(s,{id:"Mgu3+g",components:{0:e.jsx("code",{})}})})})]})]}),t&&e.jsx(k,{dir:"ltr",autoFocus:!0,defaultValue:t,spellCheck:"false",rows:Math.min(25,t.split(`
`).length),className:"font-mono whitespace-pre"})]}),e.jsx(c,{className:"my-5"}),e.jsxs(p,{type:"button",className:"mt-2 flex items-center gap-1",onClick:d,disabled:a,children:[e.jsx(o,{className:j("h-4 w-4 me-0.5",a&&"animate-spin")}),e.jsx(s,{id:"UoqckY"})]})]})}export{q as default};
