import { auth } from "@/auth"; import { prisma } from "@/lib/prisma"; import { OvertimeForm } from "./overtime-form"; import { Clock, Calendar, CheckCircle2, AlertCircle, Zap } from "lucide-react"; import { Card, CardHeader, CardTitle, CardContent, CardDescription } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; export default async function OvertimePage() { const session = await auth(); const userId = (session?.user as any)?.id; const logs = await prisma.overtime.findMany({ where: { userId }, orderBy: { date: 'desc' }, take: 10 }); const totalYTD = logs.reduce((acc, curr) => acc + curr.hours, 0); return (
Log your extra hours and track approval status.
{log.reason}
Payroll: Current Cycle
{totalYTD}h
Relative to monthly capacity
Overtime logs must be submitted within 48 hours of completion. All logs are subject to manager approval before being processed for payroll.