import { DashboardLayout } from "@/components/layout/dashboard-layout"; import { PaymentHistory } from "@/components/patient/payment-history"; import { requirePatient } from "@/lib/auth-session/auth-server"; import { prisma } from "@/lib/types/prisma"; import type { Metadata } from "next"; export const metadata: Metadata = { title: "Payment History", }; // Force dynamic rendering since this page uses authentication (headers) export const dynamic = "force-dynamic"; export default async function PaymentsPage() { const { user } = await requirePatient(); const payments = await prisma.payment.findMany({ take: 50, // Limit to 50 most recent payments where: { userId: user.id, }, include: { appointment: { include: { service: true, dentist: true, }, }, }, orderBy: { createdAt: "desc", }, }); return (

Payment History

View your payment transactions

); }