import{j as c}from"./index-b983ad9b.js";import{r as a}from"./react-b0e0d18a.js";/* empty css                *//* empty css              *//* empty css              */import{D as m}from"./Device-e8d48614.js";import{M as f}from"./antd-8ca2e36c.js";function D({roomId:t,onChange:r}){const[i,s]=a.useState();return a.useEffect(()=>{let e=!0;return t&&(async()=>{const l=await m.findAll({roomId:t}).catch(()=>{});e&&s(l||void 0)})(),()=>{e=!1}},[t]),t?c(f,{mode:"vertical",onSelect:({key:e})=>{r&&r(Number(e))},defaultSelectedKeys:["0"],items:[{key:"0",label:"所有设备"},...(i==null?void 0:i.map(e=>({key:e.id,label:e.name})))||[]]}):null}export{D as default};
