Refactor: Make photo upload reusable

This commit is contained in:
gpt-engineer-app[bot]
2025-09-29 19:34:54 +00:00
parent 4ea5da9f10
commit 63fb0a61aa
6 changed files with 308 additions and 178 deletions

44
src/types/submissions.ts Normal file
View 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;
}