23 lines
654 B
TypeScript
23 lines
654 B
TypeScript
import React from 'react'
|
|
|
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
variant?: 'primary' | 'secondary'
|
|
children: React.ReactNode
|
|
}
|
|
|
|
export function Button({ variant = 'primary', children, className = '', ...props }: ButtonProps) {
|
|
const baseClasses = 'px-4 py-2 rounded-md font-medium transition-colors'
|
|
const variantClasses = {
|
|
primary: 'bg-blue-600 text-white hover:bg-blue-700',
|
|
secondary: 'bg-gray-200 text-gray-900 hover:bg-gray-300',
|
|
}
|
|
|
|
return (
|
|
<button
|
|
className={`${baseClasses} ${variantClasses[variant]} ${className}`}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</button>
|
|
)
|
|
} |