import { FormControlLabel, Radio, RadioGroup } from "@mui/material";

function Radios({ group, value, updateData, name }) {
  return (
    <RadioGroup
      value={value}
      className="radio-mui"
      onChange={(e) => updateData(name, e.target.value)}
      sx={{
        "& .MuiFormControlLabel-root": {
          marginRight: "0 !important",
          transform: "translateX(9px)",
        },
      }}
    >
      {group.map((item, idx) => (
        <FormControlLabel
          control={<Radio className="!ml-2" />}
          className="!text-[#525252]"
          label={item}
          value={item}
          key={idx}
        />
      ))}
    </RadioGroup>
  );
}

export default Radios;
