import type { ReactNode } from "react"
import { Users, LayoutDashboard, BookOpen, FileText, ClipboardList, Library, Activity } from "lucide-react"
import type { AdminDashboardData } from "@/modules/dashboard/types"
import { Card, CardContent, CardHeader, CardTitle } from "@/shared/components/ui/card"
import { Badge } from "@/shared/components/ui/badge"
import { EmptyState } from "@/shared/components/ui/empty-state"
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/shared/components/ui/table"
import { formatDate } from "@/shared/lib/utils"
export function AdminDashboardView({ data }: { data: AdminDashboardData }) {
return (
Dashboard
System overview across users, learning content, and activity.
{data.activeSessionsCount} active sessions
{data.userCount} users
} />
} />
} />
} />
User Roles
{data.userRoleCounts.length === 0 ? (
) : (
data.userRoleCounts.map((r) => (
))
)}
Content
} />
} />
} />
} />
Homework Activity
} />
} />
} />
Recent Users
{data.recentUsers.length === 0 ? (
) : (
Name
Email
Role
Created
{data.recentUsers.map((u) => (
{u.name || "-"}
{u.email}
{u.role ?? "unknown"}
{formatDate(u.createdAt)}
))}
)}
)
}
function KpiCard({
title,
value,
icon,
}: {
title: string
value: number
icon: ReactNode
}) {
return (
{title}
{icon}
{value}
)
}
function ContentRow({
label,
value,
icon,
}: {
label: string
value: number
icon: ReactNode
}) {
return (
)
}