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 (
{/* ── Brand Panel ── */}
{[0,1,2,3,4].map(i => ( ))}
اندیشکده فولاد آینده
The Steel Futures Institute
عضویت رایگان

عضو اندیشکده شوید
و به تحلیل‌ها دسترسی داشته باشید

با ثبت‌نام رایگان به آرشیو گزارش‌های تخصصی صنعت فولاد دسترسی پیدا کنید

{['دسترسی به گزارش‌های تخصصی', 'رصد بازار و قیمت‌ها', 'شبکه خبرگان صنعت'].map((item, i) => (
{item}
))}
{/* ── Form Panel ── */}

ثبت‌نام

یک حساب کاربری جدید بسازید

setName(e.target.value)} placeholder="علی محمدی" icon={ } />
setEmail(e.target.value)} placeholder="example@email.com" icon={ } />
setPassword(e.target.value)} dir="ltr" style={inputStyle} onFocus={e => { e.target.style.borderColor = GOLD }} onBlur={e => { e.target.style.borderColor = '#e0e0e0' }} />

حداقل ۶ کاراکتر

{error && (
{error}
)}
حساب دارید؟ وارد شوید
بازگشت به سایت
) } /* helpers */ const labelStyle: React.CSSProperties = { display: 'block', color: '#444', fontSize: '0.82rem', fontWeight: 600, marginBottom: 6, } const inputStyle: React.CSSProperties = { width: '100%', padding: '0.85rem 1rem 0.85rem 2.75rem', borderRadius: 10, border: '1.5px solid #e0e0e0', background: '#fff', color: '#1a1a1a', fontSize: '0.95rem', outline: 'none', boxSizing: 'border-box', transition: 'border-color 0.2s', fontFamily: 'inherit', } function InputWithIcon({ icon, ...props }: React.InputHTMLAttributes & { icon: React.ReactNode }) { return (
{ e.target.style.borderColor = GOLD }} onBlur={e => { e.target.style.borderColor = '#e0e0e0' }} /> {icon}
) }