website refactor
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import { LeagueWalletPageQuery } from '@/lib/page-queries/page-queries/LeagueWalletPageQuery';
|
||||
import { LeagueWalletTemplate } from '@/templates/LeagueWalletTemplate';
|
||||
import { LeagueWalletPageQuery } from '@/lib/page-queries/LeagueWalletPageQuery';
|
||||
import { LeagueWalletPageClient } from './LeagueWalletPageClient';
|
||||
import { notFound } from 'next/navigation';
|
||||
|
||||
interface Props {
|
||||
params: { id: string };
|
||||
params: Promise<{ id: string }>;
|
||||
}
|
||||
|
||||
export default async function LeagueWalletPage({ params }: Props) {
|
||||
const leagueId = params.id;
|
||||
const { id: leagueId } = await params;
|
||||
|
||||
if (!leagueId) {
|
||||
notFound();
|
||||
@@ -17,17 +17,24 @@ export default async function LeagueWalletPage({ params }: Props) {
|
||||
|
||||
if (result.isErr()) {
|
||||
const error = result.getError();
|
||||
if (error.type === 'notFound') {
|
||||
if (error === 'notFound') {
|
||||
notFound();
|
||||
}
|
||||
// For serverError, show the template with empty data
|
||||
return <LeagueWalletTemplate viewData={{
|
||||
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 <LeagueWalletTemplate viewData={result.unwrap()} />;
|
||||
return <LeagueWalletPageClient viewData={result.unwrap()} />;
|
||||
}
|
||||
Reference in New Issue
Block a user