import { useState } from 'react'; import { useAuth } from '../contexts/AuthContext'; import { useThemeContext } from '../contexts/ThemeContext'; export function SignUp({ onSwitchToLogin }: { onSwitchToLogin: () => void }) { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const { signUp } = useAuth(); const { theme } = useThemeContext(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); try { setError(''); await signUp(email, password); } catch (error) { setError('Failed to create an account'); } }; return (
Already have an account?{' '}