- Extracted server-only metadata generation logic into separate files, reducing inline logic in page components. - Added `/* istanbul ignore file */` annotations for E2E-covered framework-level metadata. - Standardized `generateMetadata` export patterns across auth, admin, and error pages for consistency. - Enhanced maintainability and readability by centralizing metadata definitions for each route.
16 lines
569 B
TypeScript
16 lines
569 B
TypeScript
/* istanbul ignore file - Server-only Next.js metadata generation covered by E2E */
|
|
import type { Metadata } from 'next';
|
|
import { getTranslations } from 'next-intl/server';
|
|
import { generatePageMetadata, type Locale } from '@/lib/i18n/metadata';
|
|
|
|
export async function generateMetadata({
|
|
params,
|
|
}: {
|
|
params: Promise<{ locale: string }>;
|
|
}): Promise<Metadata> {
|
|
const { locale } = await params;
|
|
const t = await getTranslations({ locale, namespace: 'auth.register' });
|
|
|
|
return generatePageMetadata(locale as Locale, t('title'), t('subtitle'), '/register');
|
|
}
|