mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 11:51:14 -05:00
Implement strict type enforcement plan
This commit is contained in:
@@ -16,7 +16,7 @@ import { useAuth } from '@/hooks/useAuth';
|
||||
import { useProfile } from '@/hooks/useProfile';
|
||||
import { useUsernameValidation } from '@/hooks/useUsernameValidation';
|
||||
import { User, MapPin, Calendar, Star, Trophy, Settings, Camera, Edit3, Save, X, ArrowLeft, Check, AlertCircle, Loader2, UserX, FileText, Image } from 'lucide-react';
|
||||
import { Profile as ProfileType } from '@/types/database';
|
||||
import { Profile as ProfileType, ActivityEntry } from '@/types/database';
|
||||
import { supabase } from '@/integrations/supabase/client';
|
||||
import { useToast } from '@/hooks/use-toast';
|
||||
import { PhotoUpload } from '@/components/upload/PhotoUpload';
|
||||
@@ -56,7 +56,7 @@ export default function Profile() {
|
||||
coasterCount: 0,
|
||||
parkCount: 0
|
||||
});
|
||||
const [recentActivity, setRecentActivity] = useState<any[]>([]);
|
||||
const [recentActivity, setRecentActivity] = useState<ActivityEntry[]>([]);
|
||||
const [activityLoading, setActivityLoading] = useState(false);
|
||||
|
||||
// User role checking
|
||||
@@ -205,12 +205,12 @@ export default function Profile() {
|
||||
|
||||
// Combine and sort by date
|
||||
const combined = [
|
||||
...(reviews?.map(r => ({ ...r, type: 'review' })) || []),
|
||||
...(credits?.map(c => ({ ...c, type: 'credit' })) || []),
|
||||
...(submissions?.map(s => ({ ...s, type: 'submission' })) || []),
|
||||
...(rankings?.map(r => ({ ...r, type: 'ranking' })) || [])
|
||||
...(reviews?.map(r => ({ ...r, type: 'review' as const })) || []),
|
||||
...(credits?.map(c => ({ ...c, type: 'credit' as const })) || []),
|
||||
...(submissions?.map(s => ({ ...s, type: 'submission' as const })) || []),
|
||||
...(rankings?.map(r => ({ ...r, type: 'ranking' as const })) || [])
|
||||
].sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime())
|
||||
.slice(0, 15);
|
||||
.slice(0, 15) as ActivityEntry[];
|
||||
|
||||
setRecentActivity(combined);
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user