import{j as o}from"./index-7d3dbb9c.js";import{C}from"./index.esm-12cc9f7b.js";import{F}from"./FormControl-f3d9cdb4.js";import{a as f,F as g}from"./InputLabel-ade41a0b.js";import{R,a as b}from"./RadioGroup-96a8bcce.js";import{F as h}from"./FormControlLabel-4a3a4313.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};
