({ className, variant, size, render, ...props }: ButtonProps)
| 51 | } |
| 52 | |
| 53 | function Button({ className, variant, size, render, ...props }: ButtonProps) { |
| 54 | const typeValue: React.ButtonHTMLAttributes<HTMLButtonElement>["type"] = |
| 55 | render ? undefined : "button"; |
| 56 | |
| 57 | const defaultProps = { |
| 58 | className: cn(buttonVariants({ className, size, variant })), |
| 59 | "data-slot": "button", |
| 60 | type: typeValue, |
| 61 | }; |
| 62 | |
| 63 | return useRender({ |
| 64 | defaultTagName: "button", |
| 65 | props: mergeProps<"button">(defaultProps, props), |
| 66 | render, |
| 67 | }); |
| 68 | } |
| 69 | |
| 70 | export { Button, buttonVariants }; |