import React, { useContext } from 'react'; import { View, Text, Button } from 'react-native'; import { CartContext } from '../../context/CartContext'; import emailService from '../../services/emailService'; const CheckoutScreen = ({ navigation }) => { const { cart } = useContext(CartContext); const handlePayment = async () => { // Simulate payment processing alert('Payment successful!'); await emailService.sendInvoice(cart); navigation.navigate('Invoice'); }; return ( {cart.map((item, index) => ( {item.name} - ${item.price * item.quantity} ))}