WIP feat(admin-devices): enhance device management from admin with dynamic filters and improved blocking functionality

This commit is contained in:
2025-06-30 15:16:36 +05:00
parent 0157eccd57
commit 01b064aee7
7 changed files with 266 additions and 307 deletions

View File

@ -51,13 +51,6 @@ export default async function Devices({
label: "Vendor",
type: "string",
placeholder: "Enter vendor name",
}, {
label: "Amount of Devices",
name: "amount",
type: "dual-range-slider",
min: 1,
max: 100,
sliderLabel: "MVR"
}
]}
/>

View File

@ -1,9 +1,7 @@
import { AdminDevicesTable } from "@/components/admin/admin-devices-table";
import Search from "@/components/search";
import { Suspense } from "react";
import { AdminDevicesTable } from "@/components/admin/admin-devices-table";
import DynamicFilter from "@/components/generic-filter";
import Search from "@/components/search";
export default async function UserDevices({
searchParams,
@ -19,17 +17,37 @@ export default async function UserDevices({
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 Devices
</h3>
<h3 className="text-sarLinkOrange text-2xl">User Devices</h3>
</div>
<div
id="user-filters"
className=" pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
>
<Search />
<DynamicFilter
description="Filter devices by name, MAC address, or vendor."
title="Device Filter"
inputs={[
{
name: "name",
label: "Device Name",
type: "string",
placeholder: "Enter device name",
},
{
name: "mac",
label: "MAC Address",
type: "string",
placeholder: "Enter MAC address",
},
{
name: "vendor",
label: "Vendor",
type: "string",
placeholder: "Enter vendor name",
},
]}
/>
</div>
<Suspense key={query} fallback={"loading...."}>
<AdminDevicesTable parentalControl={true} searchParams={searchParams} />