import{j as o}from"./index-7414fd54.js";import{C}from"./index.esm-87a8ddec.js";import{F}from"./FormControl-0c273f44.js";import{a as f,F as g}from"./InputLabel-d3b034a6.js";import{R,a as b}from"./RadioGroup-5ab9becb.js";import{F as h}from"./FormControlLabel-a16084f0.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};
