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


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

LightButton.displayName = "LightButton";

export default LightButton;
