import React, { useState } from "react"; import { Radio, RadioGroup as MuiRadioGroup, FormControl, FormControlLabel, RadioGroupProps as MuiRadioGroupProps, } from "@mui/material"; import './radiogroup.scss'; interface RadioOption { value: string; label: string; } export interface RadioGroupProps extends MuiRadioGroupProps { options: RadioOption[]; initialValue: string; } export const RadioGroup = ({ options, initialValue, onChange, ...rest }: RadioGroupProps) => { const [selectedValue, setSelectedValue] = useState(initialValue); const handleRadioChange = (event: React.ChangeEvent) => { const newValue = event.target.value; setSelectedValue(newValue); }; return (
{options.map((option) => ( } label={option.label} /> ))}
); };