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