import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; import '../../../core/theme/halo_tokens.dart'; import '../../../core/theme/widgets/widgets.dart'; import '../../support/widgets/tanya_admin_sheet.dart'; /// Modal shown when OTP delivery / verification is exhausted (rate-limited /// 429 from `OTP_RATE_LIMIT_PHONE`, `OTP_RATE_LIMIT_IP`, `OTP_COOLDOWN`, or /// `OTP_ATTEMPTS_EXCEEDED`). Offers a "lanjut tanpa verif" exit into the /// anonymous flow and a "hubungi admin" CTA that opens the Tanya Admin sheet. /// /// By the time this popup can fire, the USP one-time gate has already been /// evaluated upstream on `VerifChoiceSheet` (either shown + marked seen, or /// skipped because already seen). The exit can therefore jump straight into /// `/payment/method-pick` regardless. class OtpBlockedPopup { const OtpBlockedPopup._(); static Future show(BuildContext context) { return HaloPopup.show( context, title: 'Verifikasi nomor lagi penuh', body: 'Sistem lagi nahan permintaan OTP buat keamanan. Kamu bisa lanjut ' 'tanpa verifikasi, atau hubungi admin biar dibantu manual.', icon: Container( width: 64, height: 64, decoration: const BoxDecoration( color: HaloTokens.brandSofter, shape: BoxShape.circle, ), alignment: Alignment.center, child: const Icon( Icons.lock_clock_outlined, color: HaloTokens.brandDark, size: 28, ), ), primary: HaloPopupAction( label: 'lanjut tanpa verif', onPressed: () => context.go('/onboarding/anon/method'), ), secondary: HaloPopupAction( label: 'hubungi admin', onPressed: () { // ignore: discarded_futures TanyaAdminSheet.show(context); }, ), ); } }