24 lines
834 B
TypeScript
24 lines
834 B
TypeScript
import TransactionsTable from "@/app/features/Pages/Transactions/TransactionsTable";
|
|
import { getTransactions } from "@/app/services/transactions";
|
|
|
|
export default async function DepositTransactionPage({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
|
}) {
|
|
// Await searchParams before processing
|
|
const params = await searchParams;
|
|
// Create a safe query string by filtering only string values
|
|
const safeParams: Record<string, string> = {};
|
|
for (const [key, value] of Object.entries(params)) {
|
|
if (typeof value === "string") {
|
|
safeParams[key] = value;
|
|
}
|
|
}
|
|
const query = new URLSearchParams(safeParams).toString();
|
|
const transactionType = 'withdrawal';
|
|
const data = await getTransactions({ transactionType, query });
|
|
|
|
return <TransactionsTable res={data}/>;
|
|
}
|