Files
sarlink-portal/app/(dashboard)/payments/page.tsx
i701 11ac852762
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m51s
chore: upgrade to tailwind v4 and add a generic filter for dynamic filter handling
2025-06-27 14:27:44 +05:00

40 lines
1.1 KiB
TypeScript

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 (
<div>
<div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
<h3 className="text-sarLinkOrange text-2xl">My Payments</h3>
</div>
<div
id="user-filters"
className=" pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
>
<Search />
</div>
<Suspense key={query} fallback={"loading...."}>
<PaymentsTable searchParams={searchParams} />
</Suspense>
</div>
);
}