import { prisma } from "@/lib/prisma"; import { Users, BarChart3, Wallet, Clock, ArrowUpRight, } from "lucide-react"; import { Card } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { formatCurrency } from "@/lib/utils"; import Link from "next/link"; export default async function AdminDashboard() { const [pendingReimbursements, pendingOvertime, totalBudget, recentTransactions] = await Promise.all([ prisma.reimbursement.count({ where: { status: 'PENDING' } }), prisma.overtime.count({ where: { status: 'PENDING' } }), prisma.budget.aggregate({ _sum: { amount: true } }), prisma.companyTransaction.findMany({ orderBy: { date: 'desc' }, take: 5 }) ]); const totalPending = pendingReimbursements + pendingOvertime; return (
Real-time overview of company finances and worker requests.
{stat.label}
{stat.trend}
{tx.description}
{new Date(tx.date).toLocaleDateString()}
{tx.type === 'DEBIT' ? '-' : '+'}{formatCurrency(tx.amount.toString())}
SuccessTotal budget utilization is at 68%. Marketing and Sales are nearing their monthly limits.