2025-01-26 01:22:33 +00:00
|
|
|
import clsx from "clsx"
|
|
|
|
|
2025-01-26 17:32:25 +00:00
|
|
|
const VARIANT_CLASSES = {
|
|
|
|
small: "text-xs py-0",
|
|
|
|
} as const
|
|
|
|
|
2025-01-26 01:22:33 +00:00
|
|
|
function Button({
|
|
|
|
className,
|
2025-01-26 17:32:25 +00:00
|
|
|
variant,
|
2025-01-26 01:22:33 +00:00
|
|
|
...props
|
|
|
|
}: React.DetailedHTMLProps<
|
|
|
|
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
|
HTMLButtonElement
|
2025-01-26 17:32:25 +00:00
|
|
|
> & { variant?: keyof typeof VARIANT_CLASSES }) {
|
2025-01-26 01:22:33 +00:00
|
|
|
return (
|
|
|
|
<button
|
|
|
|
{...props}
|
|
|
|
className={clsx(
|
2025-01-26 17:32:25 +00:00
|
|
|
"text-sm bg-neutral-200 dark:bg-neutral-700 px-2 py-1 rounded disabled:opacity-20",
|
|
|
|
variant ? VARIANT_CLASSES[variant] : "",
|
2025-01-26 01:22:33 +00:00
|
|
|
className,
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export { Button }
|