import type { MattrixwvSwitchProps } from "$/types/InputTypes";
import clsx from "clsx";
import { forwardRef } from "react";
import MattrixwvSwitch from "./MattrixwvSwitch";


const DangerSwitch = forwardRef<HTMLButtonElement, MattrixwvSwitchProps>(({
	className,
	knobClassName,
	disabled,
	...props
}, ref ) => {
	return (
		<MattrixwvSwitch
			className={clsx(
				"bg-neutral-mid",
				className,
				{
					"data-checked:bg-danger": !disabled,
					"data-checked:bg-danger-light/80": disabled
				}
			)}
			knobClassName={clsx(
				knobClassName,
				{
					"bg-white": !disabled,
					"bg-neutral-light": disabled
				}
			)}
			disabled={disabled}
			ref={ref}
			{...props}
		/>
	);
});

DangerSwitch.displayName = "DangerSwitch";

export default DangerSwitch;
