25 lines
751 B
TypeScript
25 lines
751 B
TypeScript
import { notFound } from 'next/navigation';
|
|
import { ProfileLeaguesPageQuery } from '@/lib/page-queries/page-queries/ProfileLeaguesPageQuery';
|
|
import { ProfileLeaguesTemplate } from '@/templates/ProfileLeaguesTemplate';
|
|
|
|
export default async function ProfileLeaguesPage() {
|
|
const result = await ProfileLeaguesPageQuery.execute();
|
|
|
|
if (result.isErr()) {
|
|
const error = result.getError();
|
|
|
|
if (error === 'notFound') {
|
|
notFound();
|
|
} else if (error === 'redirect') {
|
|
// In a real implementation, you'd use redirect('/')
|
|
notFound();
|
|
} else {
|
|
// For other errors, show notFound for now
|
|
notFound();
|
|
}
|
|
}
|
|
|
|
const viewData = result.unwrap();
|
|
return <ProfileLeaguesTemplate viewData={viewData} />;
|
|
}
|