Moved to next js ssr
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import type { Metadata } from 'next';
|
||||
import RacePageClient from '@/components/pages/RacePageClient';
|
||||
import { getMod, getRace } from '@/lib/api-server';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
interface Props {
|
||||
params: { modId: string; raceId: string };
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const [mod, race] = await Promise.all([getMod(params.modId), getRace(params.raceId)]);
|
||||
if (!mod || !race) {
|
||||
return { title: 'Race' };
|
||||
}
|
||||
const title = `${race.name} — ${mod.name}`;
|
||||
const description = `${race.name} race in ${mod.name} mod. Units, buildings and stats.`;
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
alternates: {
|
||||
canonical: `/mod/${params.modId}/race/${params.raceId}`,
|
||||
},
|
||||
openGraph: {
|
||||
title,
|
||||
description,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function RacePage() {
|
||||
return <RacePageClient />;
|
||||
}
|
||||
Reference in New Issue
Block a user