import { auth } from "@/auth"; import { prisma } from "@/lib/prisma"; import { FileText, Download, Eye, Search, ChevronRight, CreditCard } from "lucide-react"; import { Card } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { formatCurrency } from "@/lib/utils"; export default async function PayslipsPage() { const session = await auth(); const userId = (session?.user as any)?.id; const payslips = await prisma.payslip.findMany({ where: { userId }, orderBy: [ { year: 'desc' }, { month: 'desc' } ] }); return (

My Payslips

Securely access and download your past salary statements.

{payslips.map((slip) => ( ))}
Statement Ref Period Net Pay Date Issued Actions

PAY-{slip.year}-{slip.month.substring(0, 3).toUpperCase()}

PDF Statement

{slip.month} {slip.year}

{formatCurrency(slip.amount.toString())} {new Date(slip.createdAt).toLocaleDateString()}
{payslips.length === 0 && (

No Payslips Yet

Your payslips will appear here once issued by payroll.

)}

Payroll Information

Your salary is deposited into your primary bank account ending in ****4590 on the last business day of each month.

); }