Implement strict type enforcement plan

This commit is contained in:
gpt-engineer-app[bot]
2025-10-16 14:10:35 +00:00
parent 3bcd9e03fa
commit bc4a444138
25 changed files with 161 additions and 132 deletions

View File

@@ -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) {