File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import { verifySession } from '@/lib/auth/dal';
import { fetchBannedWords } from '@/lib/data/repositories/banned-word-repository';
import { parseBannedWordQuery } from '@/lib/domain/banned-word-query';
import { BannedWordList } from './_components/banned-word-list';
export const dynamic = 'force-dynamic';
interface PageProps {
searchParams: Promise<Record<string, string | string[] | undefined>>;
}
export default async function Page({ searchParams }: PageProps) {
await verifySession();
const query = parseBannedWordQuery(await searchParams);
const { items, totalCount } = await fetchBannedWords(query);
const totalPages = Math.max(1, Math.ceil(totalCount / query.pageSize));
const currentPage = Math.min(query.page, totalPages);
return (
<BannedWordList
items={items}
query={query}
currentPage={currentPage}
totalPages={totalPages}
totalCount={totalCount}
/>
);
}