import{r as p,b as j,j as s,L as o,F as f,aE as b}from"./index-vDL8KyrI.js";import{F as h,g as u}from"./Feature-Dn8iv4tk.js";import{L as w}from"./LastSeen-BB0rwxhg.js";import{L as y}from"./Lqi-C8sPb_IK.js";import{P as N}from"./PowerSource-DFW6CjuU.js";import{D as F}from"./DeviceImage-BpknBFw1.js";const $=p.memo(({onChange:n,onRead:m,device:e,endpoint:r,deviceState:a,lastSeenConfig:c,features:d,featureWrapperClass:x,children:g})=>{var i;const{t}=j(["zigbee","devicePage"]);return s.jsxs(s.Fragment,{children:[s.jsxs("li",{className:"list-row grow",children:[s.jsx("div",{className:"h-12 w-12",style:{overflow:"visible"},children:s.jsx(F,{disabled:!1,device:e,otaState:(i=a.update)==null?void 0:i.state})}),s.jsxs("div",{children:[s.jsxs(o,{to:`/device/${e.ieee_address}/info`,className:"link link-hover",children:[e.friendly_name,r?` (${t("endpoint")}: ${r})`:""]}),s.jsx("div",{className:"text-xs opacity-50",children:e.description||""})]}),s.jsxs("div",{className:"list-col-wrap text-sm w-full",children:[d.map(l=>(!r||!l.endpoint||l.endpoint===r)&&s.jsx(h,{feature:l,device:e,deviceState:a,onChange:n,onRead:m,featureWrapperClass:x,minimal:!0,parentFeatures:[]},u(l))),s.jsxs("div",{className:"flex flex-row items-center gap-1 mt-3",children:[s.jsx("div",{className:"grow-1"}),s.jsx(o,{to:`/device/${e.ieee_address}/exposes`,className:"link link-secondary",title:t("devicePage:exposes"),children:s.jsx(f,{icon:b,size:"xl"})})]})]})]}),s.jsxs("li",{className:"flex flex-row flex-wrap gap-1 m-4 justify-around items-center",children:[s.jsx("span",{className:"badge badge-soft badge-ghost cursor-default",title:t("last_seen"),children:s.jsx(w,{lastSeen:a.last_seen,config:c})}),s.jsx("span",{className:"badge badge-soft badge-ghost cursor-default",title:t("lqi"),children:s.jsx(y,{value:a.linkquality})}),s.jsx("span",{className:"badge badge-soft badge-ghost cursor-default",title:t("power"),children:s.jsx(N,{device:e,batteryPercent:a.battery,batteryState:a.battery_state,batteryLow:a.battery_low})}),g]})]})});export{$ as D};
