mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-22 04:51:13 -05:00
Fix: Resolve type errors in Ride and Profile components
This commit is contained in:
@@ -281,10 +281,47 @@ export interface AuditLogEntry {
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
// Activity entry - flexible structure for mixed activity types
|
||||
export interface ActivityEntry {
|
||||
// Activity entry - discriminated union for different activity types
|
||||
export type ActivityEntry =
|
||||
| ReviewActivity
|
||||
| SubmissionActivity
|
||||
| RankingActivity
|
||||
| GenericActivity;
|
||||
|
||||
interface ReviewActivity {
|
||||
id: string;
|
||||
type?: 'review' | 'credit' | 'submission' | 'ranking';
|
||||
type: 'review';
|
||||
created_at: string;
|
||||
[key: string]: unknown; // Allow any additional properties from different activity types
|
||||
rating?: number;
|
||||
parks?: { slug?: string; name?: string } | null;
|
||||
rides?: { slug?: string; name?: string; parks?: { slug?: string; name?: string } | null } | null;
|
||||
content?: string;
|
||||
title?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
interface SubmissionActivity {
|
||||
id: string;
|
||||
type: 'submission';
|
||||
created_at: string;
|
||||
status?: string;
|
||||
submission_type?: string;
|
||||
entity_type?: string;
|
||||
action?: string;
|
||||
}
|
||||
|
||||
interface RankingActivity {
|
||||
id: string;
|
||||
type: 'ranking';
|
||||
created_at: string;
|
||||
parks?: { slug?: string; name?: string } | null;
|
||||
name?: string;
|
||||
position?: number;
|
||||
}
|
||||
|
||||
interface GenericActivity {
|
||||
id: string;
|
||||
type?: string;
|
||||
created_at: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
Reference in New Issue
Block a user