"use client"; import { useId, type ReactNode } from "react"; import type { PaymentLaunchFlow } from "@/app/_hooks/use-payment-launch-flow"; import { LazyStripePaymentDialog } from "./lazy-stripe-payment-dialog"; import { stripePaymentDialogStyles as styles } from "./stripe-payment-dialog.styles"; type PaymentLaunchDialogFlow = Pick< PaymentLaunchFlow, | "handleEzpayCancel" | "handleEzpayConfirm" | "handleStripeClose" | "handleStripeConfirmed" | "isConfirmingEzpay" | "shouldShowEzpayConfirmDialog" | "shouldShowStripeDialog" | "stripeClientSecret" >; export interface PaymentLaunchDialogsProps { currentOrderId: string | null; externalCheckoutAnalyticsKey: string; ezpayDescription: ReactNode; launch: PaymentLaunchDialogFlow; stripeReturnPath?: string; } export function PaymentLaunchDialogs({ currentOrderId, externalCheckoutAnalyticsKey, ezpayDescription, launch, stripeReturnPath, }: PaymentLaunchDialogsProps) { return ( <> {launch.shouldShowEzpayConfirmDialog ? ( ) : null} {launch.shouldShowStripeDialog && launch.stripeClientSecret ? ( ) : null} ); } interface EzpayRedirectConfirmDialogProps { description: ReactNode; externalCheckoutAnalyticsKey: string; isConfirming: boolean; onCancel: () => void; onConfirm: () => void; orderId: string; } function EzpayRedirectConfirmDialog({ description, externalCheckoutAnalyticsKey, isConfirming, onCancel, onConfirm, orderId, }: EzpayRedirectConfirmDialogProps) { const titleId = useId(); return (

Continue to GCash?

{description}

Order No. {orderId}

); }