import React, { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { Card } from '../ui/Card'; import { Logo } from '../ui/Logo'; import { FiCheckCircle, FiMail, FiSmartphone, FiDownload } from 'react-icons/fi'; interface SuccessPageProps { transactionId: string; amount: number; email: string; } export const SuccessPage: React.FC = ({ transactionId, amount, email, }) => { const [emailSent, setEmailSent] = useState(false); const navigate = useNavigate(); const formatCurrency = (amount: number) => { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', }).format(amount); }; const handleSendEmail = async () => { // Simulate sending email await new Promise(resolve => setTimeout(resolve, 1000)); setEmailSent(true); // In real app, this would call an API to send the download link via email console.log('Sending download link to:', email); }; const handleDownloadIOS = () => { // In real app, this would redirect to App Store window.open('https://apps.apple.com/app/amba', '_blank'); }; const handleDownloadAndroid = () => { // In real app, this would redirect to Google Play Store window.open('https://play.google.com/store/apps/details?id=com.amba', '_blank'); }; return (
{/* Success Icon */}

Payment Successful!

Your payment of {formatCurrency(amount)} has been processed successfully.

Transaction ID: {transactionId}

{/* Download App Section */}

Download the Amba App

Get the Amba app to manage your payments and transactions on the go.

{/* Download Buttons */}
{/* Email Link Section */}

Send download link via email

{email}

{emailSent && (
Download link has been sent to your email!
)}
{/* Footer Actions */}
); };