import { authOptions } from "@/app/auth"; import { PaymentsTable } from "@/components/payments-table"; import Search from "@/components/search"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; import { Suspense } from "react"; export default async function Payments({ searchParams, }: { searchParams: Promise<{ query: string; page: number; sortBy: string; status: string; }>; }) { const query = (await searchParams)?.query || ""; const session = await getServerSession(authOptions); if (session?.user?.is_admin) { return redirect("/user-payments"); } return (