Overview
The Event Components library provides comprehensive React components for managing events, event venues, tickets, and credentials in the TradeMaster Transactions platform.EventsTable
A comprehensive data table component for displaying and managing events with advanced filtering and search capabilities.Props
Optional event ID for filtering specific events
Features
- Client Filtering: Automatically filters events by authenticated user
- Status Management: Visual status chips (Instanciado, Activo, Finalizado, En Progreso)
- Event Images: Avatar display with event media or fallback icon
- Ledger Tracking: Shows last action from event ledger
- Venue Information: Displays venue name for each event
- CSV Export: Export event data to CSV
- Permission Controls: Create button with CASL permission checks
Usage Example
Data Structure
Status Values
| Status | Color | Description |
|---|---|---|
| Instanciado | Warning (Yellow) | Event created but not yet active |
| Activo | Success (Green) | Event is currently active |
| Finalizado | Gray | Event has ended |
| En Progreso | Blue | Event is in progress |
Columns
| Column | Field | Sortable | Description |
|---|---|---|---|
| Nombre | event.name | ✓ | Event name with image/icon |
| Fecha de Inicio | date_start | ✓ | Event start date |
| Estatus | status | ✓ | Visual status chip |
| Última Acción | ledger.action | ✓ | Last ledger action with timestamp |
| Lugar del Evento | venue_name | ✓ | Event venue name |
| Acciones | - | - | View details button |
EventVenuesTable
Data table component for managing event venues (concert halls, stadiums, etc.).Props
This component doesn’t accept props as it connects directly to Redux state.Features
- Venue Images: Avatar display with venue photos
- Status Indicators: Active/Inactive status badges
- Search & Filter: Global search across venue properties
- Capacity Display: Shows maximum venue capacity
- Location Information: City/location data
- Create Permission: Permission-based venue creation
Usage Example
Data Structure
Columns
| Column | Field | Sortable |
|---|---|---|
| Nombre | name | ✓ |
| Capacidad Máxima | max_capacity | ✓ |
| Ciudad | city | ✓ |
| Estatus | status | ✓ |
| Acciones | - | - |
NewEventForm
Comprehensive form component for creating new events with validation and file uploads.Features
- Client Selection: Autocomplete for selecting event clients
- Contract Management: Select multiple contracts for an event
- Legal Contracts: Associate legal contracts with events
- Venue Selection: Choose from available event venues
- Event Types: Configurable event type selection
- Image Upload: Event banner with 2MB size limit
- Terms & Conditions: Upload event-specific T&C documents
- Date/Time Pickers: Start and end date selection
- Form Validation: Comprehensive Yup schema validation
- Secret Key Generation: Automatic security key generation
Usage Example
Form Fields
Event name
Event description
Primary event activity/genre
Secondary event activity
Event terms and conditions text
Artist or performer description
Event type from setup configuration
Selected client object
Selected legal contract
Selected event venue
Array of selected contract IDs (minimum 1)
Validation Schema
DisplayTicket
Comprehensive ticket detail display component with QR code generation.Features
- QR Code Display: Encrypted QR code for ticket validation
- Customer Information: Displays customer name, ID, email, phone
- Event Details: Event name, description, date, time
- Zone Information: Seating zone and section details
- Ticket Status: Real-time status management
- Price Display: Ticket price with currency
- Ledger History: Complete ticket action history
- Permission-based Updates: Status changes with CASL permissions
- Time Parsing: Handles both timestamp and string date formats
Usage Example
Data Structure
QR Code Encryption
The component generates an encrypted QR code using:CredentialsTableList
Manages event credentials for staff and personnel access.Props
This component doesn’t accept props but uses query parameters for event filtering.Features
- Event-specific Credentials: Filters credentials by event
- Status Management: Active/inactive credential tracking
- Search & Filter: Global search functionality
- Create Permissions: Permission-based credential creation
- Detail View: Navigate to credential details
Usage Example
Common Event Patterns
Event Status Management
Consistent status chip rendering across event components:Timestamp Conversion
Utility for converting Firestore timestamps:Event Image Display
Pattern for displaying event images with fallback:Ledger Display
Showing last action from event ledger:Integration with Firebase
Event components integrate with Firebase for data persistence:Responsive Design
All event components are fully responsive:Performance Optimization
Components use React best practices for performance:- Memoization:
React.useReffor table references - Controlled Loading: Loading states prevent premature rendering
- Efficient Updates: Redux selectors for optimal re-renders
- Lazy Loading: Images loaded on-demand