From 9926de99d6bf76b2d43e9cf9bbafcb23988a805b Mon Sep 17 00:00:00 2001 From: i701 Date: Mon, 14 Jul 2025 21:39:31 +0500 Subject: [PATCH] =?UTF-8?q?feat(filters):=20replace=20existing=20filters?= =?UTF-8?q?=20with=20dynamic=20filters=20for=20improved=20user=20and=20dev?= =?UTF-8?q?ice=20management=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/payment.ts | 1 - app/(dashboard)/parental-control/page.tsx | 27 ++++++- app/(dashboard)/profile/page.tsx | 2 +- app/(dashboard)/users/page.tsx | 90 ++++++++++++----------- 4 files changed, 74 insertions(+), 46 deletions(-) diff --git a/actions/payment.ts b/actions/payment.ts index 9eb01ef..f21e3f2 100644 --- a/actions/payment.ts +++ b/actions/payment.ts @@ -11,7 +11,6 @@ import type { Topup } from "@/lib/backend-types"; import type { TopupResponse } from "@/lib/types"; -import type { User } from "@/lib/types/user"; import { handleApiResponse } from "@/utils/tryCatch"; type GenericGetResponseProps = { diff --git a/app/(dashboard)/parental-control/page.tsx b/app/(dashboard)/parental-control/page.tsx index 09dc0be..a4047d1 100644 --- a/app/(dashboard)/parental-control/page.tsx +++ b/app/(dashboard)/parental-control/page.tsx @@ -1,5 +1,6 @@ import { Suspense } from "react"; import { DevicesTable } from "@/components/devices-table"; +import DynamicFilter from "@/components/generic-filter"; import Search from "@/components/search"; export default async function ParentalControl({ @@ -27,8 +28,30 @@ export default async function ParentalControl({ id="user-filters" className=" pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start" > - - + , - }, - { - value: "desc", - label: "Descending", - icon: , - }, -]; export default async function AdminUsers({ searchParams, @@ -43,33 +23,59 @@ export default async function AdminUsers({ id="user-table-filters" className=" pb-4 gap-4 flex items-center justify-start" > - - , + name: "first_name", + label: "User First Name", + type: "string", + placeholder: "Enter user first name", }, { - value: "unverified", - label: "Unverfieid", - icon: , + name: "last_name", + label: "User Last Name", + type: "string", + placeholder: "Enter user last name", }, { - value: "verified", - label: "Verified", - icon: , + name: "id_card", + label: "ID Card", + type: "string", + placeholder: "Enter ID card number", }, + { + name: "house_name", + label: "House Name", + type: "string", + placeholder: "Enter house name", + }, + { + name: "mobile", + label: "Phone Number", + type: "string", + placeholder: "Enter phone number", + }, + { + name: "verified", + type: "radio-group", + label: "User Status", + options: [ + { + value: "", + label: "All", + }, + { + label: "Verified", + value: "true", + }, + { + label: "Unverified", + value: "false", + }] + } ]} - defaultOption="all" - queryParamKey="status" - /> - -