import { Avatar, Badge, Box, Button, Card, Container, Grid, Group, Progress, SimpleGrid, Stack, Text, Title, } from "@mantine/core"; import { modals } from "@mantine/modals"; import { IconClock, IconDatabase, IconServer, IconUserCheck, } from "@tabler/icons-react"; import { createFileRoute, useNavigate } from "@tanstack/react-router"; import { useSnapshot } from "valtio"; import { authClient } from "@/utils/auth-client"; import { authStore } from "../../store/auth"; export const Route = createFileRoute("/admin/")({ component: DashboardComponent, }); function DashboardComponent() { const snap = useSnapshot(authStore); const navigate = useNavigate(); const openLogoutModal = () => modals.openConfirmModal({ title: "Confirm Logout", centered: true, children: Are you sure you want to log out?, labels: { confirm: "Logout", cancel: "Cancel" }, confirmProps: { color: "red" }, onConfirm: async () => { await authClient.signOut(); navigate({ to: "/signin" }); }, }); // Mock data for dashboard stats const statsData = [ { title: "Total Users", value: "1,234", icon: }, { title: "Server Uptime", value: "99.9%", icon: }, { title: "Database Load", value: "42%", icon: }, { title: "Active Sessions", value: "128", icon: }, ]; return ( Dashboard Overview {/* User Profile Card */} navigate({ to: "/profile" })} > {snap.user?.name?.charAt(0).toUpperCase()} {snap.user?.name} {snap.user?.email} Verified Account Sign Out {/* Stats Grid */} {statsData.map((stat, index) => ( {stat.title} {stat.value} {stat.icon} ))} System Performance CPU Usage 32% Memory Usage 64% Disk Usage 45% Server Status Main Server Online Database Connected Cache Running Backup Pending ); }