import { isLocale, type Locale } from "@/i18n/routes";
import { getDict } from "@/i18n/dictionaries";
import { getDb } from "@/lib/db";
import { seedIfEmpty } from "@/lib/seed";
import { getProfile, listFeaturedProjects, listProjects } from "@/lib/models";
import { BioSection } from "@/components/bio-section";
import { LinksSection } from "@/components/links-section";
import { ProjectGrid } from "@/components/project-grid";
import { JsonLd } from "@/components/json-ld";
import { buildMetadata } from "@/lib/metadata";
import Link from "next/link";
import { publicPath } from "@/i18n/routes";
export async function generateMetadata({
params,
}: {
params: Promise<{ lang: string }>;
}) {
const { lang } = await params;
const locale: Locale = isLocale(lang) ? lang : "de";
const dict = getDict(locale);
return buildMetadata(locale, dict.home.title, dict.home.lede);
}
export default async function HomePage({
params,
}: {
params: Promise<{ lang: string }>;
}) {
const { lang } = await params;
const locale: Locale = isLocale(lang) ? lang : "de";
const db = getDb();
seedIfEmpty(db);
const profile = getProfile(db, locale);
const featured = listFeaturedProjects(db, locale);
const all = listProjects(db, locale);
const dict = getDict(locale);
return (
<>
{dict.home.kicker} {dict.home.lede}
{dict.home.title}
{dict.home.cta.title}
{dict.home.cta.body}