24 lines
421 B
TypeScript
24 lines
421 B
TypeScript
"use client"
|
|
|
|
import { Slot } from "@radix-ui/react-slot"
|
|
|
|
import { buttonVariants } from "./variants"
|
|
|
|
import type { ButtonProps } from "./button"
|
|
|
|
export default function Button({
|
|
asChild = false,
|
|
className,
|
|
variant,
|
|
intent,
|
|
...props
|
|
}: ButtonProps) {
|
|
const Comp = asChild ? Slot : "button"
|
|
return (
|
|
<Comp
|
|
className={buttonVariants({ className, variant, intent })}
|
|
{...props}
|
|
/>
|
|
)
|
|
}
|