import React, { useState } from "react"; import { Sparkles, Mail, Lock, User, PawPrint } from "lucide-react"; import { useAuth } from "../context/AuthContext"; export const AuthPage: React.FC = () => { const { login, register } = useAuth(); const [isRegistering, setIsRegistering] = useState(false); const [username, setUsername] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(""); setLoading(true); try { if (isRegistering) { await register(username, email, password); } else { await login(email, password); } } catch (err: any) { setError(err.message || "Something went wrong"); } finally { setLoading(false); } }; return (
Understanding pet intent softly
PetTalk AI ยท Probabilistic Pet Behavioral Interpretation