import type { Metadata } from 'next';
import ModsPageClient from '@/components/pages/ModsPageClient';
import { getMods } from '@/lib/api-server';
import { IMod } from '@/src/types/Imod';

export const metadata: Metadata = {
    title: 'Dawn of War Wiki — юниты, расы и здания всех модов',
    description:
        'Dawn of War wiki. Unification mod wiki. Unification mod unit stats. Supported all popular mods.',
    alternates: {
        canonical: '/',
    },
};

export const dynamic = 'force-dynamic';

export default async function HomePage() {
    const mods = (await getMods()) ?? [];
    const visibleMods = mods.filter(mod => !mod.isHide);
    return <ModsPageClient initialMods={visibleMods} />;
}