import{j as o}from"./index-aa586041.js";import{C}from"./index.esm-c1bef48d.js";import{F}from"./FormControl-fed32f2b.js";import{a as f,F as g}from"./InputLabel-fa135afd.js";import{R,a as b}from"./RadioGroup-c2708961.js";import{F as h}from"./FormControlLabel-ab2ab32c.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};
