'use client' import {MobilePayment} from './mobile-payment' import {DesktopPayment} from './desktop-payment' import {TradePlatform} from '@/lib/models/trade' import {Dialog} from '@/components/ui/dialog' import {PaymentProps} from './type' export type PaymentModalProps = { onSuccess?: () => void onClose?: () => void } & PaymentProps export function PaymentModal(props: PaymentModalProps) { const handleClose = (success: boolean) => { if (success && props.onSuccess) { props.onSuccess() } } return ( { if (!open) props.onClose?.() }}> {props.platform === TradePlatform.Mobile ? ( ) : ( )} ) }