tsc fixes

This commit is contained in:
Arunavo Ray
2025-07-11 01:17:54 +05:30
parent fad78516ef
commit 938a909787
13 changed files with 69 additions and 51 deletions

View File

@@ -35,25 +35,24 @@ const buttonVariants = cva(
}
)
function Button({
className,
variant,
size,
asChild = false,
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean
}) {
const Button = React.forwardRef<
HTMLButtonElement,
React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean
}
>(({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button"
return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
ref={ref}
{...props}
/>
)
}
})
Button.displayName = "Button"
export { Button, buttonVariants }