mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-28 05:03:33 +00:00
feat(user-topups): add user topups page with dynamic filtering and admin table integration ✨
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Has been cancelled
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Has been cancelled
feat(admin-devices-table): update admin check to use is_admin and clean up device display logic ✨ feat(admin-topup-table): create admin topups table with pagination and detail view links ✨ fix(user-payments-table): correct user data access and display payment amount with currency ✨ feat(app-sidebar): add link for user topups in the admin sidebar ✨ fix(backend-types): enhance Payment interface to include user details for better data handling ✨
This commit is contained in:
@ -60,7 +60,7 @@ export default async function UserDevices({
|
||||
/>
|
||||
</div>
|
||||
<Suspense key={query} fallback={"loading...."}>
|
||||
<AdminDevicesTable parentalControl={true} searchParams={searchParams} />
|
||||
<AdminDevicesTable searchParams={searchParams} />
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
|
86
app/(dashboard)/user-topups/page.tsx
Normal file
86
app/(dashboard)/user-topups/page.tsx
Normal file
@ -0,0 +1,86 @@
|
||||
import { Suspense } from "react";
|
||||
import { AdminTopupsTable } from "@/components/admin/admin-topup-table";
|
||||
import DynamicFilter from "@/components/generic-filter";
|
||||
|
||||
export default async function UserTopups({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{
|
||||
[key: string]: string;
|
||||
}>;
|
||||
}) {
|
||||
const query = (await searchParams)?.query || "";
|
||||
// const session = await getServerSession(authOptions);
|
||||
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">User Topups</h3>
|
||||
</div>
|
||||
<DynamicFilter
|
||||
title="User Topups Filter"
|
||||
description="Filter user topups by status, topup expiry, or amount."
|
||||
inputs={[
|
||||
{
|
||||
name: "user",
|
||||
label: "User",
|
||||
type: "string",
|
||||
placeholder: "Enter user name",
|
||||
},
|
||||
{
|
||||
label: "Status",
|
||||
name: "status",
|
||||
type: "radio-group",
|
||||
options: [
|
||||
{
|
||||
label: "All",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
label: "Pending",
|
||||
value: "PENDING",
|
||||
},
|
||||
{
|
||||
label: "Cancelled",
|
||||
value: "CANCELLED",
|
||||
},
|
||||
{
|
||||
label: "Paid",
|
||||
value: "PAID",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Topup Expiry",
|
||||
name: "is_expired",
|
||||
type: "radio-group",
|
||||
options: [
|
||||
{
|
||||
label: "All",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
label: "Expired",
|
||||
value: "true",
|
||||
},
|
||||
{
|
||||
label: "Not Expired",
|
||||
value: "false",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "Topup Amount",
|
||||
name: "amount",
|
||||
type: "dual-range-slider",
|
||||
min: 0,
|
||||
max: 1000,
|
||||
step: 10,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Suspense key={query} fallback={"loading...."}>
|
||||
<AdminTopupsTable searchParams={searchParams} />
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user