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 (

Overtime Management

Log your extra hours and track approval status.

Recent Logs

{logs.map((log, i) => (
Day {new Date(log.date).getDate().toString().padStart(2, '0')}

{log.reason}

{new Date(log.date).toLocaleDateString()} {log.hours} hours
{log.status}

Payroll: Current Cycle

))}

Total Overtime (YTD)

{totalYTD}h

Relative to monthly capacity

Important Note

Overtime logs must be submitted within 48 hours of completion. All logs are subject to manager approval before being processed for payroll.

); }