"use client"; import { useActivityFeed } from "@/hooks/use-activity-feed"; import { Card, CardContent } from "@/components/ui/card"; import { Skeleton } from "@/components/ui/skeleton"; import { CheckCircle2, PlusCircle, MessageSquare, Clock, } from "lucide-react"; import type { ActivityItem } from "@/lib/supabase/database.types"; interface ActivityStatsContentProps { activities: ActivityItem[]; loading: boolean; } export function ActivityStatsContent({ activities, loading }: ActivityStatsContentProps) { const stats = { completed: activities.filter((a) => a.type === "task_completed").length, created: activities.filter((a) => a.type === "task_created").length, comments: activities.filter((a) => a.type === "comment_added").length, total: activities.length, }; const statItems = [ { label: "Tasks Completed", value: stats.completed, icon: CheckCircle2, color: "text-green-500", bgColor: "bg-green-500/10", }, { label: "Tasks Created", value: stats.created, icon: PlusCircle, color: "text-blue-500", bgColor: "bg-blue-500/10", }, { label: "Comments", value: stats.comments, icon: MessageSquare, color: "text-purple-500", bgColor: "bg-purple-500/10", }, { label: "Total Activity", value: stats.total, icon: Clock, color: "text-orange-500", bgColor: "bg-orange-500/10", }, ]; if (loading) { return (
{Array.from({ length: 4 }).map((_, i) => ( ))}
); } return (
{statItems.map((stat) => { const Icon = stat.icon; return (

{stat.value}

{stat.label}

); })}
); } export function ActivityStats() { const { activities, loading } = useActivityFeed({ limit: 100 }); return ; }