import React, { useState } from 'react' import { useNavigate, Link } from 'react-router-dom' import { useAuth } from '@/context/AuthContext' import { useLang } from '@/context/LangContext' const GOLD = '#CD9E53' const NAVY = '#032340' export default function RegisterPage() { const { lang } = useLang() const { register } = useAuth() const navigate = useNavigate() const [name, setName] = useState('') const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [showPass, setShowPass] = useState(false) const [error, setError] = useState('') const [loading, setLoading] = useState(false) const isRtl = lang === 'fa' async function handleSubmit(e: React.FormEvent) { e.preventDefault() setError('') setLoading(true) try { await register(name, email, password) navigate('/profile') } catch (err: unknown) { setError(err instanceof Error ? err.message : 'خطا در ثبتنام') } finally { setLoading(false) } } return (
با ثبتنام رایگان به آرشیو گزارشهای تخصصی صنعت فولاد دسترسی پیدا کنید
یک حساب کاربری جدید بسازید