mirror of
				https://github.com/i701/sarlink-portal.git
				synced 2025-11-04 06:26:59 +00:00 
			
		
		
		
	refactor: enhance parental control features and improve device blocking logic 🔨
This commit is contained in:
		@@ -1,18 +1,22 @@
 | 
			
		||||
import { Suspense } from "react";
 | 
			
		||||
import { DevicesTable } from "@/components/devices-table";
 | 
			
		||||
import Search from "@/components/search";
 | 
			
		||||
import { Suspense } from "react";
 | 
			
		||||
 | 
			
		||||
export default async function ParentalControl({
 | 
			
		||||
  searchParams,
 | 
			
		||||
}: {
 | 
			
		||||
  searchParams: Promise<{
 | 
			
		||||
    query: string;
 | 
			
		||||
    page: number;
 | 
			
		||||
    sortBy: string;
 | 
			
		||||
    status: string;
 | 
			
		||||
  }>;
 | 
			
		||||
}) {
 | 
			
		||||
  const query = (await searchParams)?.query || "";
 | 
			
		||||
 | 
			
		||||
  const parentalControlFilters = {
 | 
			
		||||
    is_active: "true",
 | 
			
		||||
    has_a_pending_payment: "false",
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <div>
 | 
			
		||||
      <div className="flex justify-between items-center border rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
 | 
			
		||||
@@ -25,10 +29,11 @@ export default async function ParentalControl({
 | 
			
		||||
      >
 | 
			
		||||
        <Search />
 | 
			
		||||
      </div>
 | 
			
		||||
      <Suspense key={query} fallback={"loading...."}>
 | 
			
		||||
      <Suspense key={(await searchParams).page} fallback={"loading...."}>
 | 
			
		||||
        <DevicesTable
 | 
			
		||||
          parentalControl={true}
 | 
			
		||||
          searchParams={searchParams}
 | 
			
		||||
          additionalFilters={parentalControlFilters}
 | 
			
		||||
        />
 | 
			
		||||
      </Suspense>
 | 
			
		||||
    </div>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user