import React, { ReactNode } from 'react';
import './GameButton.css';

interface GameButtonProps {
    children: ReactNode;
    onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
    variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'info' | 'warning';
    size?: 'sm' | 'md' | 'lg';
    disabled?: boolean;
    className?: string;
    style?: React.CSSProperties;
    title?: string;
}

export const GameButton: React.FC<GameButtonProps> = ({
    children,
    onClick,
    variant = 'primary',
    size = 'md',
    disabled = false,
    className = '',
    style,
    title
}) => {
    const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
        if (disabled) return;
        if (onClick) onClick(e);
    };

    return (
        <button
            className={`game-btn ${variant} ${size} ${className}`}
            onClick={handleClick}
            disabled={disabled}
            style={style}
            title={title}
        >
            {children}
        </button>
    );
};
