import { useRef, useState, useEffect } from 'react'; import { Button } from '../ui/button'; import { Card, CardContent } from '../ui/card'; import { Input } from '../ui/input'; import { Label } from '../ui/label'; import { signIn, sendVerificationEmail } from '../../lib/auth-client'; import { Package, FileCheck, MessageSquare, Camera, AlertTriangle, ChevronDown, } from 'lucide-react'; const logo = '/logo.png'; interface Props { onSignUp: () => void; onForgotPassword: () => void; } const features = [ { icon: Package, title: 'Smart Chemical Inventory', description: 'Track every chemical in your lab with detailed records — storage locations, CAS numbers, container counts, and expiration dates. Get instant alerts before stock runs low or chemicals expire.', }, { icon: FileCheck, title: 'AI Protocol Checker', description: 'Paste or upload any lab protocol and receive instant AI-powered safety feedback with citations to OSHA standards. Catch PPE gaps, ventilation requirements, and hazard oversights before they become incidents.', }, { icon: MessageSquare, title: 'Lab Safety Assistant', description: 'Ask anything about chemical handling, disposal, compatibility, or regulatory compliance. Get sourced answers drawn from OSHA, EPA, and lab safety literature — available the moment you need them.', }, { icon: Camera, title: 'Photo Label Scanning', description: 'Point your camera at any chemical label and LabWise auto-fills the inventory entry for you. Reduce manual entry errors and get new chemicals logged in seconds.', }, ]; export function LoginForm({ onSignUp, onForgotPassword }: Props) { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const [resendCooldown, setResendCooldown] = useState(0); const [resendLoading, setResendLoading] = useState(false); const aboutRef = useRef(null); const heroRef = useRef(null); useEffect(() => { if (resendCooldown <= 0) return; const t = setTimeout(() => setResendCooldown(c => c - 1), 1000); return () => clearTimeout(t); }, [resendCooldown]); async function handleResend() { setResendLoading(true); await sendVerificationEmail({ email, callbackURL: window.location.origin }); setResendLoading(false); setResendCooldown(60); } async function handleSubmit(e: React.FormEvent) { e.preventDefault(); setError(''); setLoading(true); const res = await signIn.email({ email, password, callbackURL: window.location.origin, }); setLoading(false); if (res.error) { setError(res.error.message || 'Invalid email or password'); } } async function handleGoogle() { await signIn.social({ provider: 'google', callbackURL: window.location.origin, errorCallbackURL: window.location.origin }); } function scrollToAbout() { aboutRef.current?.scrollIntoView({ behavior: 'smooth' }); } function scrollToLogin() { heroRef.current?.scrollIntoView({ behavior: 'smooth' }); } return (
{/* Sticky Navbar */} {/* Hero — login card */}

AI-powered lab management

Your lab, under control.

LabWise

Sign in to access your lab inventory and protocols.

setEmail(e.target.value)} required autoComplete="email" />
setPassword(e.target.value)} required autoComplete="current-password" />
{error && (

{error}

{error === 'Email not verified' && ( )}
)}
or
{/* Scroll hint */}
{/* About Section */}
{/* Intro */}
Built for research labs

Lab management, made easy.

LabWise brings together chemical inventory tracking, AI-powered protocol review, and real-time safety alerts in one place — so your team spends less time on paperwork and more time on research. Whether you're managing a single lab or multiple rooms across a department, LabWise keeps everything organized, compliant, and accessible.

{/* Feature grid */}
{features.map(({ icon: Icon, title, description }) => (

{title}

{description}

))}
{/* CTA */}

Ready to get started?

{/* Footer */}
© {new Date().getFullYear()} LabWise Built for research labs
); }