import PageContainer from '@/components/layout/page-container'; import { EmployeeDirectoryHeader } from '@/features/employee-directory/components/employee-directory-header'; import EmployeeDirectoryListingPage from '@/features/employee-directory/components/employee-directory-listing'; import { requireHRDDashboardAccess } from '@/lib/auth/page-guards'; import { searchParamsCache } from '@/lib/searchparams'; import type { SearchParams } from 'nuqs/server'; export const metadata = { title: 'Dashboard: Employee Directory' }; type PageProps = { searchParams: Promise; }; export default async function Page(props: PageProps) { await requireHRDDashboardAccess(); const searchParams = await props.searchParams; searchParamsCache.parse(searchParams); const search = searchParamsCache.get('search'); const company = searchParamsCache.get('company'); const department = searchParamsCache.get('department'); const position = searchParamsCache.get('position'); const status = searchParamsCache.get('status'); const sort = searchParamsCache.get('sort'); const filters = { page: searchParamsCache.get('page'), limit: searchParamsCache.get('perPage'), ...(search ? { search } : {}), ...(company ? { company } : {}), ...(department ? { department } : {}), ...(position ? { position } : {}), ...(status ? { status } : {}), ...(sort ? { sort } : {}) }; return (
); }