"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}
    />
  )
}
