diff --git a/web/components/ui/Button.tsx b/web/components/ui/Button.tsx index cfccd8e..dc7b690 100644 --- a/web/components/ui/Button.tsx +++ b/web/components/ui/Button.tsx @@ -1,10 +1,12 @@ import React from 'react'; import { THEMES } from '../../constants'; import { useTheme } from '../../contexts/ThemeContext'; +import { Spinner } from './Spinner'; interface ButtonProps extends React.ButtonHTMLAttributes { variant?: 'primary' | 'secondary' | 'danger' | 'ghost'; size?: 'sm' | 'md' | 'lg'; + isLoading?: boolean; } export const Button: React.FC = ({ @@ -12,6 +14,7 @@ export const Button: React.FC = ({ variant = 'primary', size = 'md', className = '', + isLoading = false, ...props }) => { const { style } = useTheme(); @@ -47,8 +50,10 @@ export const Button: React.FC = ({ return ( ); diff --git a/web/components/ui/Spinner.tsx b/web/components/ui/Spinner.tsx new file mode 100644 index 0000000..55b1203 --- /dev/null +++ b/web/components/ui/Spinner.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import { Loader2 } from 'lucide-react'; + +interface SpinnerProps { + className?: string; + size?: number; + ariaLabel?: string; +} + +export const Spinner: React.FC = ({ className = '', size = 18, ariaLabel = "Loading" }) => { + return ( + + ); +}; diff --git a/web/pages/Auth.tsx b/web/pages/Auth.tsx index 180001c..56582d9 100644 --- a/web/pages/Auth.tsx +++ b/web/pages/Auth.tsx @@ -3,6 +3,7 @@ import { ArrowRight, CreditCard, Sparkles } from 'lucide-react'; import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { Button } from '../components/ui/Button'; +import { Spinner } from '../components/ui/Spinner'; import { Input } from '../components/ui/Input'; import { THEMES } from '../constants'; import { useAuth } from '../contexts/AuthContext'; @@ -170,11 +171,7 @@ export const Auth = () => { }`} > {googleLoading ? ( -
+ ) : ( Google logo @@ -251,8 +248,8 @@ export const Auth = () => { )} -