import type { ButtonProps } from "$/types/ButtonTypes";
import clsx from "clsx";
import Button from "./Button";



export default function DangerButton({
	className,
	variant = "standard",
	disabled,
	...buttonProps
}: Readonly<ButtonProps>){
	return (
		<Button
			data-testid="mattrixwv-danger-button"
			variant={variant}
			disabled={disabled}
			className={clsx(
				"transition duration-300",
				className,
				//Background
				{
					"bg-danger active:bg-danger-dark": (variant === "standard") && (!disabled),
					"bg-danger-light/80": (variant === "standard") && (disabled),
					"bg-transparent": (variant === "outline" || variant === "icon"),
					"bg-transparent hover:bg-danger active:bg-danger-dark": (variant === "ghost" || variant === "outline-ghost") && (!disabled),
					"bg-transparent ": (variant === "ghost" || variant === "outline-ghost") && (disabled)
				},
				//Outline
				{
					"border-danger active:border-danger-dark": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (!disabled),
					"border-danger-light/80": (variant === "standard" || variant === "outline" || variant === "outline-ghost") && (disabled)
				},
				//Text
				{
					"text-white": variant === "standard",
					"text-danger active:text-danger-dark": (variant === "outline" || variant === "icon") && (!disabled),
					"text-danger-light/80": (variant === "outline" || variant === "icon" || variant === "ghost" || variant === "outline-ghost") && (disabled),
					"text-danger hover:text-white active:text-white": (variant === "ghost" || variant === "outline-ghost") && (!disabled)
				}
			)}
			{...buttonProps}
		/>
	);
}
