chore(release): snapshot 1.4.2
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
"use client";
|
||||
|
||||
import { ButtonHTMLAttributes, forwardRef } from "react";
|
||||
import { ButtonHTMLAttributes, forwardRef, ReactNode } from "react";
|
||||
|
||||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||
variant?: "primary" | "secondary" | "outline" | "ghost";
|
||||
size?: "sm" | "md" | "lg";
|
||||
isLoading?: boolean;
|
||||
leftIcon?: string;
|
||||
rightIcon?: string;
|
||||
leftIcon?: string | ReactNode;
|
||||
rightIcon?: string | ReactNode;
|
||||
}
|
||||
|
||||
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
@@ -55,11 +55,19 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
<i className="ri-loader-4-line animate-spin mr-2 text-[20px]" />
|
||||
)}
|
||||
{!isLoading && leftIcon && (
|
||||
<i className={`${leftIcon} mr-2 text-[20px]`} />
|
||||
typeof leftIcon === 'string' ? (
|
||||
<i className={`${leftIcon} mr-2 text-[20px]`} />
|
||||
) : (
|
||||
<div className="w-5 h-5 mr-2">{leftIcon}</div>
|
||||
)
|
||||
)}
|
||||
{children}
|
||||
{!isLoading && rightIcon && (
|
||||
<i className={`${rightIcon} ml-2 text-[20px]`} />
|
||||
typeof rightIcon === 'string' ? (
|
||||
<i className={`${rightIcon} ml-2 text-[20px]`} />
|
||||
) : (
|
||||
<div className="w-5 h-5 ml-2">{rightIcon}</div>
|
||||
)
|
||||
)}
|
||||
</button>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user