import{b as v,al as d,j as e,I as b,F as l,am as j,g as f,B as p,w as x,x as g,r as h}from"./index-vDL8KyrI.js";import{D as w,R as D}from"./DeviceControlEditName-BXFSFs5f.js";function C(t){var m;const{device:i,state:n,renameDevice:o,configureDevice:s,interviewDevice:r,removeDevice:u}=t,{t:a}=v(["zigbee","common"]),c=i.interview_state===d.InProgress||i.interview_state===d.Pending||n&&((m=n.update)==null?void 0:m.state)==="updating";return e.jsxs("div",{className:"join join-vertical lg:join-horizontal",children:[e.jsx(w,{name:i.friendly_name,renameDevice:o,homeassistantEnabled:t.homeassistantEnabled,style:"btn-primary join-item btn-square"}),e.jsx(b,{className:"btn btn-warning join-item btn-square",onClick:s,item:i.ieee_address,title:a("reconfigure"),modalDescription:a("common:dialog_confirmation_prompt"),modalCancelLabel:a("common:cancel"),disabled:c,children:e.jsx(l,{icon:j})}),e.jsx(b,{className:"btn btn-info join-item btn-square",onClick:r,item:i.ieee_address,title:a("interview"),modalDescription:a("common:dialog_confirmation_prompt"),modalCancelLabel:a("common:cancel"),disabled:c,children:e.jsx(l,{icon:f})}),e.jsx(p,{onClick:async()=>await x.show(D,{device:i,removeDevice:u}),className:"btn btn-error join-item btn-square",title:a("remove_device"),children:e.jsx(l,{icon:g})})]})}const N=h.memo(t=>{const{t:i}=v(["availability"]),{availability:n,availabilityFeatureEnabled:o,availabilityEnabledForDevice:s,disabled:r}=t;return r?e.jsx("span",{children:i("disabled")}):s??o?e.jsx("span",{className:n.state==="online"?"text-success":"text-error animate-ping",children:i(n.state)}):e.jsx("a",{className:"link link-hover",target:"_blank",rel:"noopener noreferrer",href:"https://www.zigbee2mqtt.io/guide/configuration/device-availability.html#availability-advanced-configuration",children:i("disabled")})});export{N as A,C as D};
