import{r as m,j as a,aZ as _,bd as b}from"./index-_eM6l4Nf.js";const d={value:"DUMMY",label:"DUMMY"},R=({name:n,control:o,options:s,disabled:E,placeholder:u,required:c,isLoading:l=!1,defaultValue:p=void 0,onSelectionChange:t,...D})=>{const M=e=>r=>{Array.isArray(r)||(e(r),t&&t(r))},f=m.useMemo(()=>l?[d]:s.map(e=>({label:e.label,value:e.key})),[l,s]);return a.jsx(_,{name:n,control:o,rules:{required:c},defaultValue:p,render:({field:{value:e,onChange:r}})=>a.jsx(b,{...D,isDisabled:l||E,placeholder:l?"Loading...":u,onChange:M(i=>r(i||null)),options:f,value:e})})};export{R as F};
