import classNames from 'classnames';
import { ToggleControl as Switch } from '@wordpress/components';

type ToggleSwitchProps = {
  label?: string;
  className?: string;
  onChange?: (checked: boolean) => void;
  checked?: boolean;
};

export const ToggleSwitch = ({
  label,
  className,
  onChange,
  checked,
}: ToggleSwitchProps) => {
  return (
    <div className={classNames(className, 'flex items-center gap-2')}>
      <Switch
        checked={checked}
        label={label}
        onChange={(e) => onChange(e)}
      ></Switch>
    </div>
  );
};
