import{r as m,j as a,aZ as _,be as b}from"./index-C6OVXshM.js";const x={value:"DUMMY",label:"DUMMY"},R=({name:n,control:o,options:s,disabled:u,placeholder:E,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?[x]: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||u,placeholder:l?"Loading...":E,onChange:M(i=>r(i||null)),options:f,value:e})})};export{R as F};
