import Link from 'next/link' import type { Lang } from '@/lib/i18n' import { getSeoPageBySlug } from '@/lib/seoPages' import { spanishSeoPageProfiles } from '@/lib/spanishSeoPages' import { seoTemplateCopy } from '@/lib/seoTemplateCopy' import { siteConfig, hasIosStoreUrl, hasAndroidStoreUrl } from '@/lib/site' interface SeoFooterProps { locale: Lang showMethodology?: boolean } function slugLinks(slugs: readonly string[]) { return slugs .map((slug) => getSeoPageBySlug(slug)) .filter((profile): profile is NonNullable => Boolean(profile)) .map((profile) => ({ href: profile.canonical, label: profile.h1 })) } const primarySlugs: Record, readonly string[]> = { de: [ 'pflanzen-erkennen-app', 'pflanzen-bestimmen', 'pflanzen-krankheiten-erkennen', 'pflanzen-pflege-app', 'giess-erinnerung-app', 'pflanzen-erkennen-kostenlos', ], en: [ 'plant-identifier-app', 'identify-plant-photo', 'plant-disease-identifier', 'plant-care-app', 'plant-health-app', 'best-plant-identification-app', ], } const languageHubs = [ { href: '/', label: 'Deutsch' }, { href: '/en', label: 'English' }, { href: '/es', label: 'EspaƱol' }, ] const languageTitles: Record = { de: 'Sprachen', en: 'Languages', es: 'Idiomas', } export default function SeoFooter({ locale, showMethodology = true }: SeoFooterProps) { const copy = seoTemplateCopy[locale].footer const primaryLinks = locale === 'es' ? Object.values(spanishSeoPageProfiles).map((profile) => ({ href: profile.canonical, label: profile.h1, })) : slugLinks(primarySlugs[locale]) const primaryTitle = locale === 'de' ? copy.germanTitle : locale === 'es' ? copy.spanishTitle : copy.useCasesTitle return ( ) }