import { Switch as BaseSwitch, SwitchProps } from "@nextui-org/react";

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

type SwitchComponentProps = CustomSwitchProps & SwitchProps;

function Switch({
  label,
  isDisabled,
  size,
  isSelected,
  color = "default",
  thumbIcon,
  startContent,
  endContent,
  classNames = {
    base: "",
    wrapper: "",
    thumb: "",
    label: "",
    startContent: "",
    endContent: "",
    thumbIcon: "",
  },
  onChange,
}: SwitchComponentProps) {
  return (
    <BaseSwitch
      classNames={classNames}
      color={color}
      endContent={endContent}
      isDisabled={isDisabled}
      isSelected={isSelected}
      size={size}
      startContent={startContent}
      thumbIcon={thumbIcon}
      onChange={onChange}
    >
      {label}
    </BaseSwitch>
  );
}

export default Switch;
