Files
gridpilot.gg/apps/website/app/leagues/[id]/wallet/page.tsx
Marc Mintel 1b0a1f4aee
Some checks failed
Contract Testing / contract-tests (pull_request) Failing after 7m11s
Contract Testing / contract-snapshot (pull_request) Has been skipped
view data fixes
2026-01-24 23:29:55 +01:00

42 lines
1.1 KiB
TypeScript

import { LeagueWalletPageQuery } from '@/lib/page-queries/LeagueWalletPageQuery';
import { LeagueWalletPageClient } from '@/client-wrapper/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: [],
totalWithdrawals: 0,
canWithdraw: false,
}} />;
}
return <LeagueWalletPageClient viewData={result.unwrap()} />;
}