diff --git a/src/app/quickaction-dashboard/page.tsx b/src/app/quickaction-dashboard/page.tsx index 59e0f68..a18b6a4 100644 --- a/src/app/quickaction-dashboard/page.tsx +++ b/src/app/quickaction-dashboard/page.tsx @@ -96,6 +96,32 @@ export default function QuickActionDashboardPage() { const canCompleteInfo = emailVerified && idUploaded const canSignContract = emailVerified && idUploaded && additionalInfo + // NEW: resend cooldown tracking (10 minutes like verify page) + const RESEND_INTERVAL_MS = 10 * 60 * 1000 + const getStorageKey = (email?: string | null) => `emailVerify:lastSent:${email || 'anon'}` + const getLastSentAt = (email?: string | null) => { + if (typeof window === 'undefined') return 0 + try { return parseInt(localStorage.getItem(getStorageKey(email)) || '0', 10) || 0 } catch { return 0 } + } + const [resendRemainingSec, setResendRemainingSec] = useState(0) + const formatMmSs = (total: number) => { + const m = Math.floor(total / 60) + const s = total % 60 + return `${m}:${String(s).padStart(2, '0')}` + } + + useEffect(() => { + if (!isClient || emailVerified) return + const last = getLastSentAt(user?.email) + const remainingMs = Math.max(0, RESEND_INTERVAL_MS - (Date.now() - last)) + setResendRemainingSec(Math.ceil(remainingMs / 1000)) + if (remainingMs <= 0) return + const id = setInterval(() => { + setResendRemainingSec(s => (s > 0 ? s - 1 : 0)) + }, 1000) + return () => clearInterval(id) + }, [isClient, emailVerified, user?.email]) + return (
@@ -231,18 +257,28 @@ export default function QuickActionDashboardPage() {
{/* Email Verification */} - +
+ + {/* NEW: resend feedback (only when not verified) */} + {!emailVerified && ( +

+ {resendRemainingSec > 0 + ? `Resend available in ${formatMmSs(resendRemainingSec)}` + : 'You can request a new code now'} +

+ )} +
{/* ID Upload */} +
+ + {/* NEW: Back to dashboard button */} +
+
+ {/* Helper text with validity + spam/junk reminder + support */}
- Probleme? Prüfe deinen Spam-Ordner oder{' '} - - kontaktiere den Support - + Didn’t receive the email? Please check your junk/spam folder. Still having issues?{' '} + + Contact support + .