Files
TaskPool/web/src/components/ui/button.tsx
T
2026-07-26 20:14:42 +08:00

25 lines
614 B
TypeScript

import type { ButtonHTMLAttributes } from 'react'
import { cn } from '@/lib/utils'
export type ButtonVariant = 'default' | 'secondary' | 'ghost' | 'danger' | 'outline'
export type ButtonSize = 'sm' | 'md' | 'lg' | 'icon' | 'icon-sm' | 'icon-lg'
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
variant?: ButtonVariant
size?: ButtonSize
}
export function Button({
variant = 'default',
size = 'md',
className,
...props
}: ButtonProps) {
return (
<button
className={cn('ui-btn', `ui-btn-${variant}`, `ui-btn-${size}`, className)}
{...props}
/>
)
}