Spaces:
Running
Running
| import React from 'react'; | |
| interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { | |
| variant?: 'primary' | 'secondary' | 'outline' | 'ghost'; | |
| size?: 'sm' | 'md' | 'lg'; | |
| } | |
| const Button: React.FC<ButtonProps> = ({ | |
| children, | |
| variant = 'primary', | |
| size = 'md', | |
| className = '', | |
| ...props | |
| }) => { | |
| const baseStyles = "inline-flex items-center justify-center rounded-full font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-black disabled:opacity-50 disabled:pointer-events-none"; | |
| const variants = { | |
| primary: "bg-white text-black hover:bg-gray-200 border border-transparent", | |
| secondary: "bg-gray-800 text-white hover:bg-gray-700 border border-transparent", | |
| outline: "bg-transparent text-white border border-gray-600 hover:border-gray-400 hover:text-gray-200", | |
| ghost: "bg-transparent text-white hover:bg-white/10" | |
| }; | |
| const sizes = { | |
| sm: "px-4 py-1.5 text-sm", | |
| md: "px-6 py-2.5 text-base", | |
| lg: "px-8 py-3.5 text-lg" | |
| }; | |
| return ( | |
| <button | |
| className={`${baseStyles} ${variants[variant]} ${sizes[size]} ${className}`} | |
| {...props} | |
| > | |
| {children} | |
| </button> | |
| ); | |
| }; | |
| export default Button; |