import { useEffect, useState } from "react" import { Link } from "react-router-dom" import { Users, UserPlus, UserCheck, TrendingUp, ArrowRight, List, UsersRound, Loader2, } from "lucide-react" import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../../components/ui/card" import { getUserSummary } from "../../api/users.api" import type { UserSummary } from "../../types/user.types" export function UserManagementDashboard() { const [stats, setStats] = useState(null) const [statsLoading, setStatsLoading] = useState(true) useEffect(() => { const fetchStats = async () => { try { const res = await getUserSummary() setStats(res.data.data) } catch { // silently fail — cards will show "—" } finally { setStatsLoading(false) } } fetchStats() }, []) const formatNum = (n: number) => n.toLocaleString() return (
{/* Page Header */}

User Management

Manage users, groups, and registrations.

{/* Stat Cards */}

Total Users

{statsLoading ? : stats ? formatNum(stats.total_users) : "—"}

Active Users

{statsLoading ? : stats ? formatNum(stats.active_users) : "—"}

New This Month

{statsLoading ? : stats ? formatNum(stats.joined_this_month) : "—"}

{/* Action Cards */}

Quick Actions

Register User Add new users to the system with role assignment.
Get started
User Groups Manage groups, roles, and permission settings.
Manage groups
User List Browse, search, and manage all registered users.
View all users
) }