Files
writer-work-flow/apps/web/components/ui/Button.tsx
2026-06-28 07:31:20 +02:00

37 lines
688 B
TypeScript

import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from "react";
import {
buttonClass,
type ButtonSize,
type ButtonVariant,
} from "@/lib/ui/variants";
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
children: ReactNode;
variant?: ButtonVariant;
size?: ButtonSize;
}
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
{
children,
className,
variant,
size,
type = "button",
...props
},
ref,
) {
return (
<button
ref={ref}
type={type}
className={buttonClass({ variant, size, className })}
{...props}
>
{children}
</button>
);
});