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

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

export default Radios;
