"use client"; import React, { useState } from "react"; import { useRouter } from "next/navigation"; const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; const AuthPage = () => { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [rememberMe, setRememberMe] = useState(false); const [checkboxError, setCheckboxError] = useState(false); const isEmailValid = emailRegex.test(email); const isFormValid = isEmailValid && password.length > 0; const handleSubmit = (e) => { e.preventDefault(); // проверка чекбокса if (!rememberMe) { setCheckboxError(true); return; } setCheckboxError(false); if (!isFormValid) return; console.log("Email:", email, "Password:", password, "Remember:", rememberMe); router.push('./home'); }; return (
как пользователь
*/}