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