Files
gridpilot.gg/apps/website/app/profile/sponsorship-requests/page.tsx
2026-01-18 23:43:58 +01:00

34 lines
1.0 KiB
TypeScript

import { notFound } from 'next/navigation';
import { SponsorshipRequestsPageQuery } from '@/lib/page-queries/SponsorshipRequestsPageQuery';
import { SponsorshipRequestsClient } from '@/client-wrapper/SponsorshipRequestsClient';
import { acceptSponsorshipRequest, rejectSponsorshipRequest } from '@/app/actions/sponsorshipActions';
export default async function SponsorshipRequestsPage() {
// Execute PageQuery
const queryResult = await SponsorshipRequestsPageQuery.execute();
if (queryResult.isErr()) {
const error = queryResult.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 = queryResult.unwrap();
return (
<SponsorshipRequestsClient
viewData={viewData}
onAccept={acceptSponsorshipRequest}
onReject={rejectSponsorshipRequest}
/>
);
}