mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 08:11:13 -05:00
Fix useState<any> declarations
This commit is contained in:
@@ -21,6 +21,24 @@ const PRESETS = {
|
||||
stress: { label: 'Stress', description: '~2600 submissions - Load testing', counts: '400 parks, 1000 rides, 400 companies, 200 models, 500 photo sets' }
|
||||
};
|
||||
|
||||
interface TestDataResults {
|
||||
summary: {
|
||||
operators: number;
|
||||
property_owners: number;
|
||||
manufacturers: number;
|
||||
designers: number;
|
||||
parks: number;
|
||||
rides: number;
|
||||
rideModels: number;
|
||||
photos: number;
|
||||
totalPhotoItems: number;
|
||||
conflicts: number;
|
||||
versionChains: number;
|
||||
companies?: number;
|
||||
};
|
||||
time?: string;
|
||||
}
|
||||
|
||||
export function TestDataGenerator() {
|
||||
const { toast } = useToast();
|
||||
const [preset, setPreset] = useState<'small' | 'medium' | 'large' | 'stress'>('small');
|
||||
@@ -43,7 +61,7 @@ export function TestDataGenerator() {
|
||||
includeExpiredLocks: false
|
||||
});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [results, setResults] = useState<any>(null);
|
||||
const [results, setResults] = useState<TestDataResults | null>(null);
|
||||
const [stats, setStats] = useState<{
|
||||
total: number;
|
||||
pending: number;
|
||||
|
||||
@@ -5,8 +5,30 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
interface AuthDiagnosticsData {
|
||||
timestamp: string;
|
||||
storage: {
|
||||
type: string;
|
||||
persistent: boolean;
|
||||
};
|
||||
session: {
|
||||
exists: boolean;
|
||||
user: string | null;
|
||||
expiresAt: number | null;
|
||||
error: string | null;
|
||||
};
|
||||
network: {
|
||||
online: boolean;
|
||||
};
|
||||
environment: {
|
||||
url: string;
|
||||
isIframe: boolean;
|
||||
cookiesEnabled: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export function AuthDiagnostics() {
|
||||
const [diagnostics, setDiagnostics] = useState<any>(null);
|
||||
const [diagnostics, setDiagnostics] = useState<AuthDiagnosticsData | null>(null);
|
||||
const [isOpen, setIsOpen] = useState(false);
|
||||
|
||||
const runDiagnostics = async () => {
|
||||
|
||||
@@ -16,6 +16,13 @@ interface VersionComparisonDialogProps {
|
||||
toVersionId: string;
|
||||
}
|
||||
|
||||
interface VersionDiff {
|
||||
[fieldName: string]: {
|
||||
from: unknown;
|
||||
to: unknown;
|
||||
};
|
||||
}
|
||||
|
||||
export function VersionComparisonDialog({
|
||||
open,
|
||||
onOpenChange,
|
||||
@@ -25,7 +32,7 @@ export function VersionComparisonDialog({
|
||||
toVersionId,
|
||||
}: VersionComparisonDialogProps) {
|
||||
const { versions, compareVersions } = useEntityVersions(entityType, entityId);
|
||||
const [diff, setDiff] = useState<any>(null);
|
||||
const [diff, setDiff] = useState<VersionDiff | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
const fromVersion = versions.find(v => v.version_id === fromVersionId);
|
||||
@@ -36,7 +43,7 @@ export function VersionComparisonDialog({
|
||||
if (open && fromVersionId && toVersionId) {
|
||||
setLoading(true);
|
||||
const result = await compareVersions(fromVersionId, toVersionId);
|
||||
setDiff(result);
|
||||
setDiff(result as VersionDiff);
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useParams, useNavigate, Link } from 'react-router-dom';
|
||||
import { formatDistanceToNow } from 'date-fns';
|
||||
import { User as SupabaseUser } from '@supabase/supabase-js';
|
||||
import { Header } from '@/components/layout/Header';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -134,7 +135,7 @@ export default function Profile() {
|
||||
const [profile, setProfile] = useState<ProfileType | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [editing, setEditing] = useState(false);
|
||||
const [currentUser, setCurrentUser] = useState<any>(null);
|
||||
const [currentUser, setCurrentUser] = useState<SupabaseUser | null>(null);
|
||||
const [editForm, setEditForm] = useState({
|
||||
username: '',
|
||||
display_name: '',
|
||||
|
||||
Reference in New Issue
Block a user