import{j as o}from"./index-83d9c1e2.js";import{C}from"./index.esm-82874186.js";import{F,b,a as g}from"./TextField-39c52322.js";import{R,a as f}from"./RadioGroup-1a8b9fef.js";import{F as h}from"./FormControlLabel-af5c9791.js";const H=({control:t,name:u,label:x,options:p,defaultValue:d,row:i,helperText:a,containerSx:j,onChange:s,...c})=>o.jsx(C,{control:t,name:u,defaultValue:d??"",render:({field:l,fieldState:e})=>{var m,n;return o.jsxs(F,{component:"fieldset",error:!!e.error,sx:j,children:[o.jsx(b,{component:"legend",children:x}),o.jsx(R,{...l,...c,row:i,onChange:r=>{l.onChange(r.target.value),s&&s(r)},children:p.map(r=>o.jsx(h,{value:r.value,control:o.jsx(f,{...r.radioProps}),label:r.label},r.value))}),(a||((m=e.error)==null?void 0:m.message))&&o.jsx(g,{children:((n=e.error)==null?void 0:n.message)||a})]})}});export{H as C};
