28 lines
809 B
TypeScript
28 lines
809 B
TypeScript
import { cn } from "@/app/lib/cn";
|
|
import { FC } from "react";
|
|
|
|
export type ButtonVariant = "primary" | "outline";
|
|
|
|
type Props = {
|
|
variant?: ButtonVariant;
|
|
className?: string;
|
|
} & React.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
|
|
const Button: FC<Props> = ({ variant = "primary", className, children, ...rest }) => {
|
|
return (
|
|
<button
|
|
className={cn(
|
|
"inline-flex h-10 items-center justify-center rounded-full px-6 text-sm transition-colors disabled:pointer-events-none disabled:opacity-50",
|
|
variant === "primary" && "bg-primary text-white hover:bg-primary/90",
|
|
variant === "outline" && "border border-primary bg-transparent text-primary hover:bg-primary/10",
|
|
className,
|
|
)}
|
|
{...rest}
|
|
>
|
|
{children}
|
|
</button>
|
|
);
|
|
};
|
|
|
|
export default Button;
|