diff --git a/apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx b/apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx index 0d1c5172a..cb9f84558 100644 --- a/apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx +++ b/apps/web/src/app/(dashboard)/admin/leaderboard/page.tsx @@ -4,7 +4,7 @@ import { setupI18nSSR } from '@documenso/lib/client-only/providers/i18n.server'; import { getRequiredServerComponentSession } from '@documenso/lib/next-auth/get-server-component-session'; import { isAdmin } from '@documenso/lib/next-auth/guards/is-admin'; -import { LeaderboardTable } from './data-table-leaderboard'; +import { LeaderboardTable, type SigningVolume } from './data-table-leaderboard'; import { search } from './fetch-leaderboard.actions'; type AdminLeaderboardProps = { @@ -32,7 +32,7 @@ export default async function Leaderboard({ searchParams = {} }: AdminLeaderboar const sortBy = searchParams.sortBy || 'signingVolume'; const sortOrder = searchParams.sortOrder || 'desc'; - const { leaderboard: signingVolume, totalPages } = await search({ + const { leaderboard, totalPages } = await search({ search: searchString, page, perPage, @@ -40,6 +40,13 @@ export default async function Leaderboard({ searchParams = {} }: AdminLeaderboar sortOrder, }); + // Ensure all required properties are defined and match the expected types + const typedSigningVolume: SigningVolume[] = leaderboard.map((item) => ({ + ...item, + name: item.name || '', + createdAt: item.createdAt || new Date(), + })); + return (