import{r as d,b as j,j as t,F as o,bN as g,bK as E,bO as B,bn as P,bD as f,bE as k,bF as w,bG as F,bx as m}from"./index-BeDhuS24.js";import{s as y}from"./snakeCase-DF3cbatb.js";const G=d.memo(x=>{const{device:u,batteryPercent:a,batteryState:b,batteryLow:c,showLevel:h,...n}=x,{t:i}=j("zigbee");let s;switch(u?.power_source&&(s=u.power_source),s){case"Battery":{let p=i("battery"),r="",e=f,l=!1;if(a!=null)r=`${a}%`,a>=85?e=f:a>=65?e=k:a>=40?e=w:a>=20?e=F:(e=m,l=!0);else if(b!=null)switch(r=b,b){case"high":e=f;break;case"medium":e=w;break;case"low":e=m,l=!0;break}else c!=null&&(r=c?"low":"ok",e=c?m:f);return c===!0&&(l=!0),r!==""&&(p+=`, ${i("power_level")}: ${r}`),t.jsxs("span",{className:l?"text-error":"",children:[t.jsx(o,{icon:e,fade:l,title:p,...n}),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:P,title:i(y(s)),...n});case"Emergency mains and transfer switch":case"Emergency mains constantly powered":return t.jsx(o,{icon:B,title:i(y(s)),...n});default:return u?.type==="GreenPower"?t.jsx(o,{icon:g,title:"Green",...n}):t.jsx(o,{icon:E,title:s?i(y(s)):void 0,...n})}});export{G as P};
