"use client";
import { Badge } from "~/components/ui/badge";
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
export function SystemStats() {
// TODO: Implement admin.getSystemStats API endpoint
// const { data: stats, isLoading } = api.admin.getSystemStats.useQuery({});
const isLoading = false;
if (isLoading) {
return (
{Array.from({ length: 4 }).map((_, i) => (
))}
);
}
// Mock data for now since we don't have the actual admin router implemented
const mockStats = {
totalUsers: 42,
totalStudies: 15,
totalExperiments: 38,
totalTrials: 127,
activeTrials: 3,
systemHealth: "healthy",
uptime: "7 days, 14 hours",
storageUsed: "2.3 GB",
};
const displayStats = mockStats;
return (
{/* Total Users */}
Total Users
{displayStats.totalUsers}
All roles
{/* Total Studies */}
Studies
{displayStats.totalStudies}
Active
{/* Total Experiments */}
Experiments
{displayStats.totalExperiments}
Published
{/* Total Trials */}
Trials
{displayStats.totalTrials}
{displayStats.activeTrials} running
{/* System Health */}
System Health
{displayStats.systemHealth === "healthy" ? "Healthy" : "Issues"}
All services operational
{/* Uptime */}
Uptime
{displayStats.uptime}
Since last restart
{/* Storage Usage */}
Storage Used
{displayStats.storageUsed}
Media & database
{/* Recent Activity */}
Recent Activity
2 trials started today
1 new user registered
3 experiments published
);
}