import{r as j,u as g,j as a,F as c,k,bn as B,bp as E,h as P,bq as f,br as v,bs as x,bt as F,bu as y}from"./index-ClCsMWbS.js";import{s as w}from"./snakeCase-D0nOJtgb.js";const Q=j.memo(h=>{const{device:m,batteryPercent:s,batteryState:b,batteryLow:u,showLevel:d,...i}=h,{t:l}=g("zigbee");let r;switch(m?.power_source&&(r=m.power_source),r){case"Battery":{let t=l(p=>p.battery),n="",e=f,o=!1;if(s!=null)n=`${s}%`,s>=85?e=f:s>=65?e=v:s>=40?e=x:s>=20?e=F:(e=y,o=!0);else if(b!=null)switch(n=b,b){case"high":e=f;break;case"medium":e=x;break;case"low":e=y,o=!0;break}else u!=null&&(n=u?"low":"ok",e=u?y:f);return u===!0&&(o=!0),n!==""&&(t+=`, ${l(p=>p.power_level)}: ${n}`),a.jsxs("span",{className:o?"text-error":"",children:[a.jsx(c,{icon:e,fade:o,title:t,...i}),d&&a.jsx("span",{className:"ps-2",children:n})]})}case"Mains (single phase)":case"Mains (3 phase)":case"DC Source":return a.jsx(c,{icon:P,title:l(t=>t[w(r)]),...i});case"Emergency mains and transfer switch":case"Emergency mains constantly powered":return a.jsx(c,{icon:E,title:l(t=>t[w(r)]),...i});default:return m?.type==="GreenPower"?a.jsx(c,{icon:k,title:"Green",...i}):a.jsx(c,{icon:B,title:r?l(t=>t[w(r)]):void 0,...i})}});export{Q as P};
