/** * Admin dashboard page. * URL: /admin * Shows community statistics and recent activity. * @see specs/prd-web.md Section M11 */ 'use client' import { useState, useEffect, useCallback } from 'react' import { ChatCircle, Users, FolderSimple, WarningCircle, TrendUp } from '@phosphor-icons/react' import { AdminLayout } from '@/components/admin/admin-layout' import { ErrorAlert } from '@/components/error-alert' import { getCommunityStats } from '@/lib/api/client' import type { CommunityStats } from '@/lib/api/types' import { useAuth } from '@/hooks/use-auth' import { PluginSlot } from '@/components/plugin-slot' interface StatCardProps { label: string value: number recentValue: number icon: typeof ChatCircle } function StatCard({ label, value, recentValue, icon: Icon }: StatCardProps) { return (
{value}
{label}
Loading statistics...
} {error &&