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