import{b,ao as m,j as e,R as d,F as l,ap as u,e as f,B as j,w as p,x,r as h}from"./index-DtyjNqrf.js";import{D as w,R as g}from"./DeviceControlEditName-CIF4s9nK.js";function _(t){const{device:i,state:n,renameDevice:o,configureDevice:s,interviewDevice:r,removeDevice:v}=t,{t:a}=b(["zigbee","common"]),c=i.interview_state===m.InProgress||i.interview_state===m.Pending||n&&n.update?.state==="updating";return e.jsxs("div",{className:"join join-horizontal",children:[e.jsx(w,{name:i.friendly_name,renameDevice:o,homeassistantEnabled:t.homeassistantEnabled,style:"btn-outline btn-primary join-item btn-square"}),e.jsx(d,{className:"btn btn-outline 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:u})}),e.jsx(d,{className:"btn btn-outline 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(j,{onClick:async()=>await p.show(g,{device:i,removeDevice:v}),className:"btn btn-outline btn-error join-item btn-square",title:a("remove_device"),children:e.jsx(l,{icon:x})})]})}const C=h.memo(t=>{const{t:i}=b(["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-pulse",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{C as A,_ as D};
