i701 aa18484475
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 13m55s
refactor: add tryCatch utility for error handling, update device-related components and types, and clean up unused code in payment actions
2025-04-05 16:07:11 +05:00

38 lines
1.1 KiB
TypeScript

import { authOptions } from "@/app/auth";
import { DevicesTable } from "@/components/devices-table";
import Search from "@/components/search";
import AddDeviceDialogForm from "@/components/user/add-device-dialog";
import { getServerSession } from "next-auth";
import React, { Suspense } from "react";
export default async function Devices({
searchParams,
}: {
searchParams: Promise<{
query: string;
page: number;
sortBy: string;
status: string;
}>;
}) {
const query = (await searchParams)?.query || "";
const session = await getServerSession(authOptions);
return (
<div>
<div className="flex justify-between items-center border-[1px] rounded-md border-dashed font-bold title-bg py-4 px-2 mb-4">
<h3 className="text-sarLinkOrange text-2xl">My Devices</h3>
<AddDeviceDialogForm user_id={session?.user?.id} />
</div>
<div
id="user-filters"
className=" pb-4 gap-4 flex sm:flex-row flex-col items-start justify-start"
>
<Search />
</div>
<Suspense key={query} fallback={"loading...."}>
<DevicesTable parentalControl={false} searchParams={searchParams} />
</Suspense>
</div>
);
}