diff --git a/src/features/payments/components/PaymentSheet.tsx b/src/features/payments/components/PaymentSheet.tsx index e2b8e35..43be25f 100644 --- a/src/features/payments/components/PaymentSheet.tsx +++ b/src/features/payments/components/PaymentSheet.tsx @@ -6,31 +6,16 @@ function formatCurrencyIDR(amount: number) { return new Intl.NumberFormat('id-ID', { style: 'currency', currency: 'IDR', maximumFractionDigits: 0 }).format(amount) } -function useCountdown(expireAt: number) { - const [now, setNow] = React.useState(() => Date.now()) - React.useEffect(() => { - const id = setInterval(() => setNow(Date.now()), 1000) - return () => clearInterval(id) - }, []) - const remainMs = Math.max(0, expireAt - now) - const totalSec = Math.floor(remainMs / 1000) - const hh = String(Math.floor(totalSec / 3600)).padStart(2, '0') - const mm = String(Math.floor((totalSec % 3600) / 60)).padStart(2, '0') - const ss = String(totalSec % 60).padStart(2, '0') - return `${hh}:${mm}:${ss}` -} - export interface PaymentSheetProps { merchantName?: string orderId: string amount: number - expireAt: number // epoch ms customerName?: string children?: React.ReactNode showStatusCTA?: boolean } -export function PaymentSheet({ merchantName = 'Simaya', orderId, amount, expireAt, customerName, children, showStatusCTA = true }: PaymentSheetProps) { +export function PaymentSheet({ merchantName = 'Simaya', orderId, amount, customerName, children, showStatusCTA = true }: PaymentSheetProps) { const [expanded, setExpanded] = React.useState(true) return (