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 type { Metadata } from 'next';
import { verifySession } from '@/lib/auth/dal';
import { fetchAdminMembers } from '@/lib/data/repositories/admin-member-repository';
import { parseAdminMemberQuery } from '@/lib/domain/admin-member-query';
import { AdminMemberList } from './_components/admin-member-list';
export const metadata: Metadata = {
title: '관리자 회원',
};
interface PageProps {
searchParams: Promise<Record<string, string | string[] | undefined>>;
}
export default async function Page({ searchParams }: PageProps) {
const admin = await verifySession();
const query = parseAdminMemberQuery(await searchParams);
const { items, totalCount } = await fetchAdminMembers(query);
const totalPages = Math.max(1, Math.ceil(totalCount / query.pageSize));
const currentPage = Math.min(query.page, totalPages);
return (
<AdminMemberList
items={items}
query={query}
currentPage={currentPage}
totalPages={totalPages}
totalCount={totalCount}
currentAdminId={admin.id}
/>
);
}