add signatures

This commit is contained in:
horsefacts
2024-11-23 23:55:52 -05:00
committed by lucas-neynar
parent 33eea440b3
commit 2bbf813e20
2 changed files with 118 additions and 9 deletions

View File

@@ -1,14 +1,21 @@
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
children: React.ReactNode;
isLoading?: boolean;
}
export function Button({ children, className = "", ...props }: ButtonProps) {
export function Button({ children, className = "", isLoading = false, ...props }: ButtonProps) {
return (
<button
className={`w-full max-w-xs mx-auto block bg-[#7C65C1] text-white py-3 px-6 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-[#7C65C1] hover:bg-[#6952A3] ${className}`}
{...props}
>
{children}
{isLoading ? (
<div className="flex items-center justify-center">
<div className="animate-spin h-5 w-5 border-2 border-white border-t-transparent rounded-full" />
</div>
) : (
children
)}
</button>
);
}