| 1 | import { cn } from '@renderer/lib/utils' |
| 2 | import React from 'react' |
| 3 | |
| 4 | interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> { |
| 5 | variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'ghost' |
| 6 | size?: 'sm' | 'md' | 'lg' |
| 7 | } |
| 8 | |
| 9 | export function Button({ |
| 10 | className, |
| 11 | variant = 'default', |
| 12 | size = 'md', |
| 13 | ...props |
| 14 | }: ButtonProps): React.JSX.Element { |
| 15 | return ( |
| 16 | <button |
| 17 | className={cn( |
| 18 | 'inline-flex items-center justify-center whitespace-nowrap rounded-lg font-medium leading-none transition-all', |
| 19 | 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring', |
| 20 | 'disabled:pointer-events-none disabled:opacity-50 disabled:grayscale', |
| 21 | '[&_svg]:shrink-0', |
| 22 | 'cursor-pointer', |
| 23 | { |
| 24 | 'bg-gradient-to-r from-[#6f8159] to-[#4f613f] text-white shadow-lg shadow-[#5d6b4d]/30 hover:shadow-xl hover:shadow-[#5d6b4d]/40': |
| 25 | variant === 'default', |
| 26 | 'bg-gradient-to-r from-[#8fbc8f] to-[#6f8f64] text-[#2f3b28] shadow-lg shadow-[#7da77f]/30 hover:shadow-xl hover:shadow-[#7da77f]/40': |
| 27 | variant === 'secondary', |
| 28 | 'bg-gradient-to-r from-[#c97a64] to-[#b15a58] text-white shadow-lg shadow-[#b15a58]/30 hover:shadow-xl hover:shadow-[#b15a58]/40': |
| 29 | variant === 'destructive', |
| 30 | 'soft-btn text-foreground': variant === 'outline', |
| 31 | 'bg-transparent text-muted-foreground hover:bg-[#ebe4d6]/80 hover:text-accent-foreground shadow-none': |
| 32 | variant === 'ghost' |
| 33 | }, |
| 34 | { |
| 35 | 'h-9 px-4 text-sm': size === 'sm', |
| 36 | 'h-11 px-5 text-sm': size === 'md', |
| 37 | 'h-12 px-7 text-base': size === 'lg' |
| 38 | }, |
| 39 | className |
| 40 | )} |
| 41 | {...props} |
| 42 | /> |
| 43 | ) |
| 44 | } |
| 45 |