mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-24 05:51:15 -05:00
Refactor: Make photo upload reusable
This commit is contained in:
44
src/types/submissions.ts
Normal file
44
src/types/submissions.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
export type EntityType =
|
||||
| 'park'
|
||||
| 'ride'
|
||||
| 'manufacturer'
|
||||
| 'operator'
|
||||
| 'designer'
|
||||
| 'property_owner';
|
||||
|
||||
export interface PhotoSubmission {
|
||||
url: string;
|
||||
caption?: string;
|
||||
title?: string;
|
||||
date?: string;
|
||||
order: number;
|
||||
}
|
||||
|
||||
export interface PhotoSubmissionContent {
|
||||
title?: string;
|
||||
photos: PhotoSubmission[];
|
||||
context: EntityType;
|
||||
entity_id: string;
|
||||
// Legacy support
|
||||
park_id?: string;
|
||||
ride_id?: string;
|
||||
company_id?: string;
|
||||
}
|
||||
|
||||
export interface EntityPhotoGalleryProps {
|
||||
entityId: string;
|
||||
entityType: EntityType;
|
||||
entityName: string;
|
||||
parentId?: string; // e.g., parkId for a ride
|
||||
}
|
||||
|
||||
export interface UppyPhotoSubmissionUploadProps {
|
||||
onSubmissionComplete?: () => void;
|
||||
entityId: string;
|
||||
entityType: EntityType;
|
||||
parentId?: string; // Optional parent (e.g., parkId for rides)
|
||||
|
||||
// Deprecated (kept for backwards compatibility)
|
||||
parkId?: string;
|
||||
rideId?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user