diff --git a/src/app/(super-admin-routes)/user-management/page.tsx b/src/app/(super-admin-routes)/user-management/page.tsx index 764c323..3cdd6bb 100644 --- a/src/app/(super-admin-routes)/user-management/page.tsx +++ b/src/app/(super-admin-routes)/user-management/page.tsx @@ -2,24 +2,14 @@ import React from "react"; import { UserTableProvider } from "~/components/patterns/data-table/data-table-provider"; import { UserTable } from "~/components/patterns/data-table/user-table/user-table"; -import { searchParamsSchema } from "~/components/patterns/data-table/validations"; - -import { type SearchParams } from "~/types/data-table"; - -export interface UserManagementPageProps { - searchParams: SearchParams; -} - -const UserManagement = ({ searchParams }: UserManagementPageProps) => { - const search = searchParamsSchema.parse(searchParams); - console.log({ parsedSearch: search, searchParams }); +const UserManagement = () => { return (

User Management

- +
); diff --git a/src/components/patterns/data-table/user-table/user-table.tsx b/src/components/patterns/data-table/user-table/user-table.tsx index f6074fa..12d5ef3 100644 --- a/src/components/patterns/data-table/user-table/user-table.tsx +++ b/src/components/patterns/data-table/user-table/user-table.tsx @@ -13,17 +13,17 @@ import { filterableColumns, } from "./user-table-columns"; import { TableSkeleton } from "../table-skeleton"; -import { type z } from "zod"; -import { type searchParamsSchema } from "../validations"; -export function UserTable({ - search, -}: { - search: z.infer; -}) { +import { searchParamsSchema } from "../validations"; +import { useSearchParams } from "next/navigation"; + +export function UserTable() { const { enableAdvancedFilter } = useUserTable(); + const searchParams = useSearchParams(); - console.log({ search }); + const search = searchParamsSchema.parse( + Object.fromEntries(searchParams.entries()), + ); const { data, isLoading } = api.superAdmin.getUserData.useQuery( {