Files
gridpilot.gg/apps/website/app/leagues/[id]/wallet/page.tsx
2026-01-16 01:00:03 +01:00

40 lines
1.0 KiB
TypeScript

import { LeagueWalletPageQuery } from '@/lib/page-queries/LeagueWalletPageQuery';
import { LeagueWalletPageClient } from './LeagueWalletPageClient';
import { notFound } from 'next/navigation';
interface Props {
params: Promise<{ id: string }>;
}
export default async function LeagueWalletPage({ params }: Props) {
const { id: leagueId } = await params;
if (!leagueId) {
notFound();
}
const result = await LeagueWalletPageQuery.execute(leagueId);
if (result.isErr()) {
const error = result.getError();
if (error === 'notFound') {
notFound();
}
// For serverError, show the template with empty data
return <LeagueWalletPageClient viewData={{
leagueId,
balance: 0,
formattedBalance: '$0.00',
totalRevenue: 0,
formattedTotalRevenue: '$0.00',
totalFees: 0,
formattedTotalFees: '$0.00',
pendingPayouts: 0,
formattedPendingPayouts: '$0.00',
currency: 'USD',
transactions: [],
}} />;
}
return <LeagueWalletPageClient viewData={result.unwrap()} />;
}