import ToggleButton from "react-bootstrap/ToggleButton";
import ToggleButtonGroup from "react-bootstrap/ToggleButtonGroup";

const Toggle = (props) => {
  const { onClick, handleToggle, value } = props;
  return (
    <>
      <ToggleButtonGroup
        type="radio"
        name="options"
        value={value}
        onChange={handleToggle}
        defaultValue={2}
      >
        <ToggleButton
          onClick={(e) => onClick(2)}
          id="tbg-radio-1"
          value={2}
        ></ToggleButton>

        <ToggleButton
          onClick={(e) => onClick(1)}
          id="tbg-radio-2"
          value={1}
        ></ToggleButton>
      </ToggleButtonGroup>
    </>
  );
};

export default Toggle;
