import ToggleProps from "./Toggle.interface";
import "./Toggle.scss";

const Toggle = ({ name, checked, setChecked }: ToggleProps) => {
  return (
    <div className="toggle">
      <label className="switch">
        <input
          type="checkbox"
          checked={checked}
          onChange={(e) => setChecked(e.target.checked)}
        />
        <span className="slider round"></span>
      </label>
      <span>{name}</span>
    </div>
  );
};

export default Toggle;
