import React, { useState } from 'react'; import { MOCK_USERS } from '../types/auth'; import { MOCK_EVENTS, MOCK_TICKET_TYPES, DEFAULT_FEE_STRUCTURE, type EventLite } from '../types/business'; import { FeeBreakdown } from './billing'; import { OrderSummary } from './checkout'; import { EventCard } from './events'; import { MainContainer } from './layout'; import { ScanStatusBadge } from './scanning'; import { TicketTypeRow } from './tickets'; import { Button } from './ui/Button'; import { Card, CardHeader, CardBody } from './ui/Card'; import type { Order, ScanStatus } from '../types/business'; const DomainShowcase: React.FC = () => { const [currentUser] = useState(MOCK_USERS[1]); // Organizer user // Create example EventLite objects from MOCK_EVENTS const exampleEvents: EventLite[] = MOCK_EVENTS.map((event) => ({ id: event.id, orgId: event.organizationId, name: event.title, startAt: event.date, endAt: event.date, // Using same date for end time since MOCK_EVENTS doesn't have endAt venue: event.venue, territoryId: event.territoryId, status: event.status === 'published' ? 'published' : event.status === 'draft' ? 'draft' : 'archived' })); const [scanStatuses, setScanStatuses] = useState([ { isValid: true, status: 'valid', timestamp: new Date().toISOString(), ticketInfo: { eventTitle: 'Autumn Gala & Silent Auction', ticketTypeName: 'VIP Patron', customerEmail: 'customer@example.com', seatNumber: 'A12' } }, { isValid: false, status: 'used', timestamp: new Date(Date.now() - 300000).toISOString(), errorMessage: 'This ticket was already scanned 5 minutes ago' }, { isValid: false, status: 'invalid', errorMessage: 'QR code format is not recognized' } ]); // Mock order data const mockOrder: Order = { id: 'ord-123', eventId: 'evt-1', customerEmail: 'customer@example.com', items: [ { ticketTypeId: 'tt-1', ticketTypeName: 'VIP Patron', price: 35000, quantity: 2, subtotal: 70000 }, { ticketTypeId: 'tt-2', ticketTypeName: 'General Admission', price: 15000, quantity: 1, subtotal: 15000 } ], subtotal: 85000, platformFee: 3075, processingFee: 2495, tax: 7875, total: 98445, status: 'pending', createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() }; const handleEventAction = (_action: string, _eventId: string) => { // Handle event actions in real application }; const handleTicketAction = (_action: string, _ticketTypeId: string, _value?: unknown) => { // Handle ticket type actions in real application }; const handlePromoCode = async (_code: string) => { // Apply promo code in real application // Simulate API call await new Promise(resolve => setTimeout(resolve, 1000)); return { success: false, error: 'Promo code not found' }; }; const simulateScan = () => { const isValid = Math.random() > 0.5; const newStatus: ScanStatus = { isValid, status: Math.random() > 0.7 ? 'valid' : 'invalid', timestamp: new Date().toISOString(), ...(isValid ? {} : { errorMessage: 'Invalid QR format' }), ticketInfo: { eventTitle: 'Contemporary Dance Showcase', ticketTypeName: 'General Admission', customerEmail: 'test@example.com' } }; setScanStatuses(prev => [newStatus, ...prev.slice(0, 4)]); }; return (

Domain Components Showcase

Professional event ticketing components for upscale venues with glassmorphism design

{/* Event Cards Section */}

Event Cards

Display event information with role-based actions and glassmorphism styling

{exampleEvents.map((event) => ( handleEventAction('hover', eventId)} /> ))}
{/* Ticket Type Management Section */}

Ticket Type Management

Manage ticket types with inline editing and inventory tracking

{/* Card Layout */}

Card Layout (Mobile-Friendly)

{MOCK_TICKET_TYPES.map((ticketType) => ( handleTicketAction('edit', tt.id)} onDelete={(id) => handleTicketAction('delete', id)} onToggleStatus={(id, status) => handleTicketAction('toggle-status', id, status)} onQuantityUpdate={(id, quantity) => handleTicketAction('quantity-update', id, quantity)} onPriceUpdate={(id, price) => handleTicketAction('price-update', id, price)} /> ))}
{/* Table Layout */}

Table Layout (Desktop)

{MOCK_TICKET_TYPES.map((ticketType) => ( handleTicketAction('edit', tt.id)} onDelete={(id) => handleTicketAction('delete', id)} onToggleStatus={(id, status) => handleTicketAction('toggle-status', id, status)} onQuantityUpdate={(id, quantity) => handleTicketAction('quantity-update', id, quantity)} onPriceUpdate={(id, price) => handleTicketAction('price-update', id, price)} /> ))}
Ticket Type Price Quantity Sold Available Sales Rate Revenue Actions
{/* Order Summary & Fee Breakdown Section */}

Checkout Experience

Professional order summary with transparent fee breakdown

{/* Order Summary */}

Order Summary

{ /* Remove promo code */ }} />

Compact Layout

{/* Fee Breakdown */}

Fee Breakdown

Table Layout

{/* Scanning Interface Section */}

QR Scanning Interface

Real-time ticket validation with status indicators and animations

{scanStatuses.map((status, index) => (

Scan Result #{scanStatuses.length - index}

))}
{/* Different Sizes */}

Badge Sizes

{/* Usage Examples */}

Usage Examples

Integration Code

{`import { EventCard, TicketTypeRow, OrderSummary, ScanStatusBadge, FeeBreakdown } from '../components';

// Event listing page


// Ticket management


// Checkout process


// QR scanning


// Admin fee transparency
`}
              
); }; export default DomainShowcase;