import { useState, useEffect } from 'react' import { useNavigate } from 'react-router-dom' import { CheckCircle, Clock, TrendingUp, Timer } from 'lucide-react' import type { LucideIcon } from 'lucide-react' import { sidebarApi } from '@/api' import { cn } from '@/lib/utils' import { Skeleton } from '@/components/ui/Skeleton' interface StatCard { label: string value: string | number icon: LucideIcon iconColor: string href: string highlight?: boolean } export function PerformanceCards() { const navigate = useNavigate() const [resolved, setResolved] = useState(0) const [active, setActive] = useState(0) const [totalMinutes, setTotalMinutes] = useState(0) const [loading, setLoading] = useState(true) const [error, setError] = useState(false) useEffect(() => { sidebarApi.getStats() .then((stats) => { setResolved(stats.resolved_today) setActive(stats.active_count) setTotalMinutes(stats.total_session_minutes_today) }) .catch(() => setError(true)) .finally(() => setLoading(false)) }, []) if (loading) { return (
Unable to load performance data