2import { authService, AuthUser } from '../../services/authService';
3
4interface LoginPageProps {
5 onLogin: (user: AuthUser) => void;
6}
7
8export default function LoginPage({ onLogin }: LoginPageProps) {
9 const [isSignUp, setIsSignUp] = useState(false);
10 const [email, setEmail] = useState('');
11 const [password, setPassword] = useState('');
12 const [displayName, setDisplayName] = useState('');
13 const [loading, setLoading] = useState(false);
14 const [error, setError] = useState('');
15
16 const handleSubmit = async (e: React.FormEvent) => {
17 e.preventDefault();
18 setLoading(true);
19 setError('');
20
21 try {
22 if (isSignUp) {Powered by SnippSync • Always fresh, always in sync
Create snippets that automatically sync with your GitHub repositories. Never worry about outdated documentation again.