import{j as o}from"./index-6fe66247.js";import{C}from"./index.esm-8dc7c617.js";import{F}from"./FormControl-cc4d9109.js";import{a as f,F as g}from"./InputLabel-76d7f8cb.js";import{R,a as b}from"./RadioGroup-6c343587.js";import{F as h}from"./FormControlLabel-27833f01.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(f,{component:"legend",children:u}),o.jsx(R,{...m,...c,row:d,onChange:r=>{m.onChange(r.target.value),s&&s(r)},children:x.map(r=>o.jsx(h,{value:r.value,control:o.jsx(b,{...r.radioProps}),label:r.label},r.value))}),(a||((l=e.error)==null?void 0:l.message))&&o.jsx(g,{children:((n=e.error)==null?void 0:n.message)||a})]})}});export{P as C};
