chore: update dashboard ui

This commit is contained in:
BennyKok
2024-01-07 23:01:53 +08:00
parent 08b2ff8b09
commit af42f625c8
4 changed files with 58 additions and 14 deletions
+6 -2
View File
@@ -36,11 +36,15 @@ export interface ButtonProps
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
VariantProps<typeof buttonVariants> {
asChild?: boolean;
as?: React.ElementType;
}
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot : "button";
(
{ className, variant, size, asChild = false, as = "button", ...props },
ref
) => {
const Comp = asChild ? Slot : as;
return (
<Comp
className={cn(buttonVariants({ variant, size, className }))}