Fix: Resolve type errors in Ride and Profile components

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 14:17:17 +00:00
parent bc4a444138
commit b84b40f05d
4 changed files with 104 additions and 37 deletions

View File

@@ -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;
}