import{M as l,g as d,K as m,o as v,c as p,n as w,i as f,al as g}from"./index-Bb2UEb_P.js";const S=l({__name:"ServerStatusBadge",props:{indicators:{}},setup(u){const r=u,n=d(()=>r.indicators?c(r.indicators):{code:"Unknown",name:""});function c(e){const t=Object.values(e);let a={code:"Unknown",name:""};if(t.some(s=>s.Status==="Warning")){a.code="Warning";const s=t.find(o=>o.Status==="Warning");a.name=i(s)}if(t.some(s=>s.Status==="Critical")){a.code="Critical";const s=t.find(o=>o.Status==="Critical");a.name=i(s)}return t.every(s=>s.Status==="Ok")&&(a.code="Ok"),a}function i(e){let t="";return e&&(e.Units&&e.Limit?t=`${e.Name}: ${e.Used} / ${e.Limit} ${e.Units}`:t=`${e.Name}: ${e.Used}`),t}return(e,t)=>{const a=g("tooltip");return n.value?m((v(),p("div",{key:0,class:w(["tw-size-4 tw-rounded-full tw-flex-none tw-border",{"tw-bg-status-active/60 tw-border-status-active":n.value.code==="Ok","tw-bg-status-prolong/60 tw-border-status-prolong":n.value.code==="Warning","tw-bg-status-suspended/60 tw-border-status-suspended":n.value.code==="Critical","tw-bg-status-deleted/60 tw-border-status-deleted":n.value.code==="Unknown"}])},null,2)),[[a,n.value.name]]):f("",!0)}}});export{S as _};
