| 1 | import Link from "next/link"; |
| 2 | import { GITEE_ENABLED, type Locale } from "@/lib/i18n/config"; |
| 3 | import { getChrome } from "@/lib/i18n/dictionaries"; |
| 4 | import { |
| 5 | footerLegalLinks, |
| 6 | footerProductLinks, |
| 7 | footerProjectLinks, |
| 8 | REPO_RELEASES_URL, |
| 9 | REPO_URL, |
| 10 | } from "@/lib/i18n/links"; |
| 11 | import { SITE_CONTACT_EMAIL, SITE_SECURITY_EMAIL } from "@/lib/page-meta"; |
| 12 | import { Strata } from "./strata"; |
| 13 | import { USAGE_COUNTING_COPY } from "@/lib/content/usage-counting"; |
| 14 | import { pickText } from "@/lib/i18n/dictionaries"; |
| 15 | |
| 16 | /** |
| 17 | * Site footer. One dictionary path for every routed locale — the previous |
| 18 | * en / zh / dictionary triple branch is gone, and the Product column now |
| 19 | * carries the full six-link set everywhere (footerGuide and footerFaq exist |
| 20 | * in ChromeDict as of #4934). |
| 21 | */ |
| 22 | export function Footer({ locale = "en" }: { locale?: Locale }) { |
| 23 | const chrome = getChrome(locale); |
| 24 | const homeHref = `/${locale}`; |
| 25 | const product = footerProductLinks(locale, chrome); |
| 26 | const project = footerProjectLinks(locale, chrome); |
| 27 | const legal = footerLegalLinks(locale, chrome); |
| 28 | |
| 29 | return ( |
| 30 | <footer className="site-footer"> |
| 31 | {/* The waterline: every page still on paper descends here into the |
| 32 | seabed. The homepage is already under water by now, and the |
| 33 | stylesheet hides this band behind its ocean column. */} |
| 34 | <div className="site-footer-waterline" aria-hidden="true"> |
| 35 | <Strata variant="band" /> |
| 36 | </div> |
| 37 | <div className="site-footer-main"> |
| 38 | <div className="site-footer-brand"> |
| 39 | <Link href={homeHref} className="site-wordmark site-wordmark-footer"> |
| 40 | <img src="/brand/wordmark-inverted.svg" alt="Codewhale" height={18} /> |
| 41 | </Link> |
| 42 | <p>{chrome.footerTagline}</p> |
| 43 | </div> |
| 44 | |
| 45 | <div className="site-footer-links"> |
| 46 | <div> |
| 47 | <span>{chrome.footerProduct}</span> |
| 48 | {product.map((item) => <Link key={item.href} href={item.href}>{item.label}</Link>)} |
| 49 | </div> |
| 50 | <div> |
| 51 | <span>{chrome.footerProject}</span> |
| 52 | {project.map((item) => <Link key={item.href} href={item.href}>{item.label}</Link>)} |
| 53 | </div> |
| 54 | </div> |
| 55 | </div> |
| 56 | |
| 57 | <div className="site-footer-meta"> |
| 58 | <p> |
| 59 | {chrome.footerCanonicalSource} |
| 60 | <a href={REPO_URL}>github.com/Hmbown/CodeWhale</a> |
| 61 | {chrome.footerReleases} |
| 62 | <a href={REPO_RELEASES_URL}>{chrome.footerReleasesLink}</a> |
| 63 | </p> |
| 64 | <div> |
| 65 | {legal.map((item) => <Link key={item.href} href={item.href}>{item.label}</Link>)} |
| 66 | {GITEE_ENABLED && <a href="https://gitee.com/Hmbown/CodeWhale">Gitee</a>} |
| 67 | <a href="https://cnb.cool/codewhale.net/codewhale">CNB</a> |
| 68 | <a href="https://npmmirror.com/package/codewhale">npmmirror</a> |
| 69 | <a href={`mailto:${SITE_CONTACT_EMAIL}`}>{SITE_CONTACT_EMAIL}</a> |
| 70 | <a href={`mailto:${SITE_SECURITY_EMAIL}`}>{chrome.footerSecurity}</a> |
| 71 | <Link href={`/${locale}/legal/privacy#usage-counting`}>{pickText(USAGE_COUNTING_COPY.footerLink, locale)}</Link> |
| 72 | </div> |
| 73 | <span>© {new Date().getFullYear()} Codewhale</span> |
| 74 | </div> |
| 75 | </footer> |
| 76 | ); |
| 77 | } |
| 78 |