Fix type errors in admin components

This commit is contained in:
gpt-engineer-app[bot]
2025-11-03 01:24:54 +00:00
parent 8281fb9852
commit 2ce837f376
7 changed files with 45 additions and 41 deletions

View File

@@ -9,10 +9,10 @@ import { supabase } from '@/integrations/supabase/client';
import { format } from 'date-fns';
interface DuplicateStats {
date: string;
total_attempts: number;
duplicates_prevented: number;
prevention_rate: number;
date: string | null;
total_attempts: number | null;
duplicates_prevented: number | null;
prevention_rate: number | null;
health_status: 'healthy' | 'warning' | 'critical';
}
@@ -20,11 +20,11 @@ interface RecentDuplicate {
id: string;
user_id: string;
channel: string;
idempotency_key: string;
idempotency_key: string | null;
created_at: string;
profiles?: {
username: string;
display_name: string;
display_name: string | null;
};
}
@@ -165,11 +165,11 @@ export function NotificationDebugPanel() {
</TableHeader>
<TableBody>
{stats.map((stat) => (
<TableRow key={stat.date}>
<TableCell>{format(new Date(stat.date), 'MMM d, yyyy')}</TableCell>
<TableCell className="text-right">{stat.total_attempts}</TableCell>
<TableCell className="text-right">{stat.duplicates_prevented}</TableCell>
<TableCell className="text-right">{stat.prevention_rate.toFixed(1)}%</TableCell>
<TableRow key={stat.date || 'unknown'}>
<TableCell>{stat.date ? format(new Date(stat.date), 'MMM d, yyyy') : 'N/A'}</TableCell>
<TableCell className="text-right">{stat.total_attempts ?? 0}</TableCell>
<TableCell className="text-right">{stat.duplicates_prevented ?? 0}</TableCell>
<TableCell className="text-right">{stat.prevention_rate !== null ? stat.prevention_rate.toFixed(1) : 'N/A'}%</TableCell>
<TableCell>{getHealthBadge(stat.health_status)}</TableCell>
</TableRow>
))}