Spaces:
Sleeping
Sleeping
File size: 621 Bytes
1829efb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | import type { ButtonHTMLAttributes } from 'react'
import { twMerge } from 'tailwind-merge'
interface AppButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
active?: boolean
}
export function AppButton({
active,
className = '',
type = 'button',
...props
}: AppButtonProps) {
return (
<button
type={type}
className={twMerge(
'inline-flex items-center text-xs gap-2 justify-start rounded px-2 py-1 opacity-80 transition-[background-color,opacity] hover:bg-white/10 hover:opacity-100',
active && 'opacity-100',
className,
)}
{...props}
/>
)
}
|