import{r as p,b as g,j as s,L as i,F as f,aR as j}from"./index-BeDhuS24.js";import{F as b,g as h}from"./Feature-B18PTY7Z.js";import{L as u}from"./LastSeen-Tt-X3bir.js";import{L as w}from"./Lqi-Bexjv2VI.js";import{P as N}from"./PowerSource-M8I2qqUm.js";import{D as y}from"./DeviceImage-CGx5yo8m.js";const D=p.memo(({onChange:o,onRead:n,device:e,endpoint:r,deviceState:a,lastSeenConfig:m,features:c,featureWrapperClass:d,children:x})=>{const{t}=g(["zigbee","devicePage"]);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"card-body p-2",children:[s.jsxs("div",{className:"flex flex-row items-center gap-3 w-full",children:[s.jsx("div",{className:"flex-none h-11 w-11 overflow-visible",children:s.jsx(y,{disabled:!1,device:e,otaState:a.update?.state})}),s.jsxs("div",{className:"min-w-0",children:[s.jsxs(i,{to:`/device/${e.ieee_address}/info`,className:"link link-hover",children:[e.friendly_name,r?` (${t("endpoint")}: ${r})`:""]}),e.description&&s.jsx("div",{className:"text-xs opacity-50 truncate",title:e.description,children:e.description})]})]}),s.jsxs("div",{className:"text-sm w-full p-2",children:[c.map(l=>(!r||!l.endpoint||l.endpoint===r)&&s.jsx(b,{feature:l,device:e,deviceState:a,onChange:o,onRead:n,featureWrapperClass:d,minimal:!0,parentFeatures:[]},h(l))),s.jsxs("div",{className:"flex flex-row items-center gap-1 mt-3",children:[s.jsx("div",{className:"grow-1"}),s.jsxs(i,{to:`/device/${e.ieee_address}/exposes`,className:"btn btn-xs",children:[t("devicePage:exposes")," ",s.jsx(f,{icon:j,size:"lg"})]})]})]})]}),s.jsxs("div",{className:"flex flex-row flex-wrap gap-1 mx-2 mb-2 justify-around items-center",children:[s.jsx("span",{className:"badge badge-soft badge-ghost cursor-default",title:t("last_seen"),children:s.jsx(u,{lastSeen:a.last_seen,config:m})}),s.jsx("span",{className:"badge badge-soft badge-ghost cursor-default",title:t("lqi"),children:s.jsx(w,{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,showLevel:!0})}),x]})]})});export{D};
