"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import Logo from "@/components/Logo"; import GiteaMark from "@/components/GiteaMark"; import { ArrowUpRight } from "lucide-react"; import { SITE } from "@/lib/seo"; import { LOCALES, getLocalizedHref } from "@/components/LanguageSelector"; const BASE_COLUMNS = [ { title: "Explorar", links: [ { href: "/series", label: "Séries ESP32" }, { href: "/comparacao", label: "Comparador" }, { href: "/catalogo", label: "Catálogo de placas" }, { href: "/livro", label: "O livro", livroOnly: true }, ], }, { title: "Ferramentas", links: [ { href: "/seletor", label: "Seletor inteligente" }, { href: "/diagnostico", label: "Diagnóstico" }, { href: "/componentes", label: "Component Registry" }, { href: "/frameworks", label: "Frameworks e SDKs" }, ], }, { title: "Projeto", links: [ { href: "/sobre", label: "Sobre o ESPDocs" }, { href: "/glossario", label: "Glossário" }, { href: SITE.repositorio, label: "Repositório", external: true }, { href: `${SITE.repositorio}/issues`, label: "Reportar um problema", external: true }, ], }, ]; export default function Footer() { const pathname = usePathname() || ""; const year = new Date().getFullYear(); const currentLocale = LOCALES.find((l) => pathname === `/${l.code}` || pathname.startsWith(`/${l.code}/`))?.code || "pt"; const isPt = currentLocale === "pt"; const getLinkHref = (href) => getLocalizedHref(`/${currentLocale}${href}`, currentLocale); const columns = BASE_COLUMNS.map((col) => ({ ...col, links: col.links.filter((l) => !l.livroOnly || isPt), })); return ( ); }