|
|
@@ -1,9 +1,8 @@
|
|
|
import * as React from 'react'
|
|
|
import { Slot } from '@radix-ui/react-slot'
|
|
|
+import { IconLoader2 } from '@tabler/icons-react'
|
|
|
import { cva, type VariantProps } from 'class-variance-authority'
|
|
|
-
|
|
|
import { cn } from '@/lib/utils'
|
|
|
-import { IconLoader2 } from '@tabler/icons-react'
|
|
|
|
|
|
const buttonVariants = cva(
|
|
|
'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',
|
|
|
@@ -52,12 +51,13 @@ type ButtonProps = ButtonPropsBase &
|
|
|
|
|
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
({ className, variant, size, children, ...props }, ref) => {
|
|
|
- if (props.asChild) {
|
|
|
+ const { asChild, ...rest } = props
|
|
|
+ if (asChild) {
|
|
|
return (
|
|
|
<Slot
|
|
|
className={cn(buttonVariants({ variant, size, className }))}
|
|
|
ref={ref}
|
|
|
- {...props}
|
|
|
+ {...rest}
|
|
|
>
|
|
|
{children}
|
|
|
</Slot>
|