import { useState } from 'react'; import { supabase } from '../supabaseClient'; type AuthMode = 'login' | 'signup'; export const AuthPage = ({ onAuth }: { onAuth: () => void }) => { const [mode, setMode] = useState('login'); const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [loading, setLoading] = useState(false); const [error, setError] = useState(''); const [successMsg, setSuccessMsg] = useState(''); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setSuccessMsg(''); setLoading(true); try { if (mode === 'login') { const { error: err } = await supabase.auth.signInWithPassword({ email, password }); if (err) throw err; onAuth(); } else { const { error: err } = await supabase.auth.signUp({ email, password, options: { emailRedirectTo: window.location.origin } }); if (err) throw err; setSuccessMsg('We sent you a confirmation link. Check your email to continue.'); } } catch (err: any) { setError(err.message || 'Authentication failed'); } setLoading(false); }; const handleGoogleLogin = async () => { setError(''); const { error: err } = await supabase.auth.signInWithOAuth({ provider: 'google', options: { redirectTo: window.location.origin } }); if (err) setError(err.message || 'Google sign in failed'); }; return (
{/* ── Left Panel: Brand Story ── */}
AgentIC

Text to Silicon.
Autonomously.

Describe any digital chip in plain English. Our multi-agent AI system writes RTL, verifies logic, runs formal proofs, and generates fabrication-ready GDSII — all without human intervention.

15-Stage Pipeline
From spec to silicon in one command
🧠
Self-Healing AI
Auto-fixes bugs across verification loops
🔬
Sky130 PDK
Open-source fabrication-ready output
Trusted by chip designers worldwide
{/* ── Right Panel: Auth Form ── */}

{mode === 'login' ? 'Welcome back' : 'Get started'}

{mode === 'login' ? 'Sign in to your workspace' : 'Create your account to start building'}

setEmail(e.target.value)} required autoFocus autoComplete="email" />
setPassword(e.target.value)} required minLength={6} autoComplete={mode === 'login' ? 'current-password' : 'new-password'} />
{error && (
{error}
)} {successMsg && (
{successMsg}
)}
OR
{mode === 'login' ? "Don't have an account?" : 'Already have an account?'}

By continuing, you agree to AgentIC's Terms of Service and Privacy Policy.

); };