import{j as r}from"./index-7d3dbb9c.js";import{C as f}from"./index.esm-12cc9f7b.js";import{F as j}from"./FormControl-f3d9cdb4.js";import{F}from"./FormControlLabel-4a3a4313.js";import{S as u}from"./Switch-92fc8bbc.js";import{F as g}from"./InputLabel-ade41a0b.js";const y=({name:a,control:n,label:c,helperText:e,required:l=!1,disabled:m=!1,formControlProps:i,rules:p,...h})=>r.jsx(f,{name:a,control:n,rules:p,render:({field:t,fieldState:x})=>{const{error:o}=x,s=!!o;return r.jsxs(j,{error:s,disabled:m,required:l,...i,children:[r.jsx(F,{control:r.jsx(u,{...t,checked:t.value||!1,onChange:C=>t.onChange(C.target.checked),disabled:m,color:s?"error":"primary",...h}),label:c}),(e||s)&&r.jsx(g,{children:s?o==null?void 0:o.message:e})]})}});export{y as C};
