mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 13:11:12 -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' }
|
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() {
|
export function TestDataGenerator() {
|
||||||
const { toast } = useToast();
|
const { toast } = useToast();
|
||||||
const [preset, setPreset] = useState<'small' | 'medium' | 'large' | 'stress'>('small');
|
const [preset, setPreset] = useState<'small' | 'medium' | 'large' | 'stress'>('small');
|
||||||
@@ -43,7 +61,7 @@ export function TestDataGenerator() {
|
|||||||
includeExpiredLocks: false
|
includeExpiredLocks: false
|
||||||
});
|
});
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [results, setResults] = useState<any>(null);
|
const [results, setResults] = useState<TestDataResults | null>(null);
|
||||||
const [stats, setStats] = useState<{
|
const [stats, setStats] = useState<{
|
||||||
total: number;
|
total: number;
|
||||||
pending: number;
|
pending: number;
|
||||||
|
|||||||
@@ -5,8 +5,30 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/com
|
|||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { Button } from '@/components/ui/button';
|
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() {
|
export function AuthDiagnostics() {
|
||||||
const [diagnostics, setDiagnostics] = useState<any>(null);
|
const [diagnostics, setDiagnostics] = useState<AuthDiagnosticsData | null>(null);
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
const runDiagnostics = async () => {
|
const runDiagnostics = async () => {
|
||||||
|
|||||||
@@ -16,6 +16,13 @@ interface VersionComparisonDialogProps {
|
|||||||
toVersionId: string;
|
toVersionId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface VersionDiff {
|
||||||
|
[fieldName: string]: {
|
||||||
|
from: unknown;
|
||||||
|
to: unknown;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export function VersionComparisonDialog({
|
export function VersionComparisonDialog({
|
||||||
open,
|
open,
|
||||||
onOpenChange,
|
onOpenChange,
|
||||||
@@ -25,7 +32,7 @@ export function VersionComparisonDialog({
|
|||||||
toVersionId,
|
toVersionId,
|
||||||
}: VersionComparisonDialogProps) {
|
}: VersionComparisonDialogProps) {
|
||||||
const { versions, compareVersions } = useEntityVersions(entityType, entityId);
|
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 [loading, setLoading] = useState(true);
|
||||||
|
|
||||||
const fromVersion = versions.find(v => v.version_id === fromVersionId);
|
const fromVersion = versions.find(v => v.version_id === fromVersionId);
|
||||||
@@ -36,7 +43,7 @@ export function VersionComparisonDialog({
|
|||||||
if (open && fromVersionId && toVersionId) {
|
if (open && fromVersionId && toVersionId) {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await compareVersions(fromVersionId, toVersionId);
|
const result = await compareVersions(fromVersionId, toVersionId);
|
||||||
setDiff(result);
|
setDiff(result as VersionDiff);
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useParams, useNavigate, Link } from 'react-router-dom';
|
import { useParams, useNavigate, Link } from 'react-router-dom';
|
||||||
import { formatDistanceToNow } from 'date-fns';
|
import { formatDistanceToNow } from 'date-fns';
|
||||||
|
import { User as SupabaseUser } from '@supabase/supabase-js';
|
||||||
import { Header } from '@/components/layout/Header';
|
import { Header } from '@/components/layout/Header';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Input } from '@/components/ui/input';
|
import { Input } from '@/components/ui/input';
|
||||||
@@ -134,7 +135,7 @@ export default function Profile() {
|
|||||||
const [profile, setProfile] = useState<ProfileType | null>(null);
|
const [profile, setProfile] = useState<ProfileType | null>(null);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [editing, setEditing] = useState(false);
|
const [editing, setEditing] = useState(false);
|
||||||
const [currentUser, setCurrentUser] = useState<any>(null);
|
const [currentUser, setCurrentUser] = useState<SupabaseUser | null>(null);
|
||||||
const [editForm, setEditForm] = useState({
|
const [editForm, setEditForm] = useState({
|
||||||
username: '',
|
username: '',
|
||||||
display_name: '',
|
display_name: '',
|
||||||
|
|||||||
Reference in New Issue
Block a user