import{j as o}from"./index-5768b108.js";import{C}from"./index.esm-4803c918.js";import{F}from"./FormControl-47bb025d.js";import{a as f,F as g}from"./InputLabel-bfa922b7.js";import{R,a as b}from"./RadioGroup-b694c34a.js";import{F as h}from"./FormControlLabel-a8ce6f4f.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};
