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


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