This commit is contained in:
hamid zarghami
2026-06-06 11:19:02 +03:30
parent 24ff9a4100
commit 8cb22ef9fd
5 changed files with 106 additions and 30 deletions
+10 -4
View File
@@ -22,6 +22,15 @@ type Props = {
pending?: boolean | undefined
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'id'>
const formatCountdown = (seconds: number) => {
const mins = Math.floor(seconds / 60)
const secs = seconds % 60
if (mins > 0) {
return `${mins}:${String(secs).padStart(2, '0')}`
}
return String(seconds)
}
function StepEnterOtp ({
onChange,
onClick,
@@ -87,10 +96,7 @@ function StepEnterOtp ({
<div>
{timerRunning ? (
<div>
{t('OTP.TimerRunning').replace(
'{seconds}',
String(secondsLeft)
)}
{t('OTP.TimerRunning', { time: formatCountdown(secondsLeft) })}
</div>
) : (
<div>