import React from 'react'; import { Document, Page, Text, View, Image, StyleSheet, } from '@react-pdf/renderer'; interface TicketPDFProps { userName?: string; eventName?: string; eventDate?: string; eventTime?: string; venue?: string; ticketType?: string; amount?: string; qrCodeDataUrl?: string; ticketNumber?: string; purchaseDate?: string; orderId?: string; seatNumber?: string; section?: string; } export const TicketPDF = ({ userName = 'Kirubel', eventName = 'Summer Music Festival 2024', eventDate = 'July 15, 2024', eventTime = '7:00 PM', venue = 'City Park Amphitheater', ticketType = 'General Admission', amount = '$75.00', qrCodeDataUrl, ticketNumber = 'EVT-12345', purchaseDate = new Date().toLocaleDateString(), orderId = 'ORD-12345', seatNumber, section, }: TicketPDFProps) => { return ( {/* Header */} AMBA Event Ticket {/* Ticket Number Badge */} TICKET #{ticketNumber} {/* Event Information Section */} Event Details Event Name: {eventName} Date: {eventDate} Time: {eventTime} Venue: {venue} {/* Ticket Holder Information */} Ticket Holder Name: {userName} Ticket Type: {ticketType} {seatNumber && ( Seat: {seatNumber} )} {section && ( Section: {section} )} {/* Payment Information */} Payment Information Amount Paid: {amount} Order ID: {orderId} Purchase Date: {purchaseDate} {/* QR Code Section */} {qrCodeDataUrl && ( Entry QR Code Present this QR code at the venue entrance for quick access Ticket Number: {ticketNumber} )} {/* Footer */} This ticket is non-transferable and non-refundable. Please arrive at least 30 minutes before the event start time. For support, contact: support@amba.app {/* Terms and Conditions */} Terms & Conditions • This ticket grants admission to the specified event only • The ticket holder must present valid ID if requested • The venue reserves the right to refuse entry • Lost or stolen tickets cannot be replaced • Recording devices may be prohibited ); }; const styles = StyleSheet.create({ page: { padding: 40, backgroundColor: '#ffffff', fontFamily: 'Helvetica', }, header: { marginBottom: 30, textAlign: 'center', borderBottom: '2px solid #105D38', paddingBottom: 20, }, headerTitle: { fontSize: 32, fontWeight: 'bold', color: '#105D38', marginBottom: 5, }, headerSubtitle: { fontSize: 16, color: '#666666', textTransform: 'uppercase', letterSpacing: 2, }, ticketBadge: { backgroundColor: '#105D38', padding: 10, borderRadius: 5, marginBottom: 25, textAlign: 'center', }, ticketBadgeText: { color: '#ffffff', fontSize: 14, fontWeight: 'bold', textAlign: 'center', }, section: { marginBottom: 20, padding: 15, backgroundColor: '#f8fafc', borderRadius: 5, border: '1px solid #e2e8f0', }, sectionTitle: { fontSize: 18, fontWeight: 'bold', color: '#1e293b', marginBottom: 12, borderBottom: '1px solid #cbd5e1', paddingBottom: 8, }, infoRow: { flexDirection: 'row', justifyContent: 'space-between', marginBottom: 10, paddingBottom: 8, borderBottom: '1px solid #e2e8f0', }, infoLabel: { fontSize: 12, color: '#FFB668', fontWeight: '600', flex: 1, }, infoValue: { fontSize: 12, color: '#105D38', fontWeight: 'normal', flex: 2, textAlign: 'right', }, qrSection: { marginTop: 30, marginBottom: 20, padding: 20, backgroundColor: '#E6F4EC', borderRadius: 5, border: '2px solid #FFB668', alignItems: 'center', }, qrTitle: { fontSize: 20, fontWeight: 'bold', color: '#105D38', marginBottom: 8, }, qrInstructions: { fontSize: 11, color: '#666666', marginBottom: 15, textAlign: 'center', }, qrContainer: { padding: 15, backgroundColor: '#ffffff', borderRadius: 5, border: '2px solid #cbd5e1', marginBottom: 10, }, qrCode: { width: 200, height: 200, }, qrNote: { fontSize: 10, color: '#666666', marginTop: 10, fontWeight: 'bold', }, footer: { marginTop: 20, marginBottom: 15, padding: 15, backgroundColor: '#f8fafc', borderRadius: 5, border: '1px solid #e2e8f0', }, footerText: { fontSize: 9, color: '#64748b', marginBottom: 5, textAlign: 'center', lineHeight: 1.4, }, termsSection: { marginTop: 15, padding: 15, backgroundColor: '#fff7ed', borderRadius: 5, border: '1px solid #fed7aa', }, termsTitle: { fontSize: 14, fontWeight: 'bold', color: '#9a3412', marginBottom: 10, }, termsText: { fontSize: 9, color: '#7c2d12', marginBottom: 5, lineHeight: 1.4, }, }); export default TicketPDF;