import { useState } from 'react'; import { Smartphone, ArrowLeft, ShieldCheck } from 'lucide-react'; export default function Auth({ onLogin }) { const [step, setStep] = useState(1); const [phone, setPhone] = useState(''); const [otp, setOtp] = useState(''); const [loading, setLoading] = useState(false); const handleSendOtp = (e) => { e.preventDefault(); if (phone.length < 10) return alert('شماره موبایل معتبر نیست'); setLoading(true); setTimeout(() => { setLoading(false); setStep(2); }, 1000); }; const handleVerifyOtp = (e) => { e.preventDefault(); setLoading(true); setTimeout(() => { setLoading(false); onLogin(phone); }, 1000); }; return (

{step === 1 ? 'ورود به حساب' : 'تایید شماره'}

{step === 1 ? 'برای ادامه شماره موبایل خود را وارد کنید' : `کد تایید برای ${phone} ارسال شد (کد تست: 1234)`}

{step === 1 ? (
setPhone(e.target.value)} className="glass-input w-full p-4 rounded-xl text-center text-lg tracking-widest placeholder:text-white/30" dir="ltr" />
) : (
setOtp(e.target.value)} className="glass-input w-full p-4 rounded-xl text-center text-2xl tracking-[0.5em] placeholder:text-white/30" maxLength={4} dir="ltr" />
)} {step === 2 && ( )}
); }