返回 CodeWhale
footer.tsx
根目录 / web / components / footer.tsx
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 footerProductLinks,
6 footerProjectLinks,
7 REPO_RELEASES_URL,
8 REPO_URL,
9 } from "@/lib/i18n/links";
10 import { Whale } from "./whale";
11
12 /**
13 * Site footer. One dictionary path for every routed locale — the previous
14 * en / zh / dictionary triple branch is gone, and the Product column now
15 * carries the full six-link set everywhere (footerGuide and footerFaq exist
16 * in ChromeDict as of #4934).
17 */
18 export function Footer({ locale = "en" }: { locale?: Locale }) {
19 const chrome = getChrome(locale);
20 const homeHref = `/${locale}`;
21 const product = footerProductLinks(locale, chrome);
22 const project = footerProjectLinks(locale, chrome);
23
24 return (
25 <footer className="site-footer">
26 <div className="site-footer-main">
27 <div className="site-footer-brand">
28 <Link href={homeHref} className="site-wordmark site-wordmark-footer">
29 <Whale size={31} caustic />
30 <span>Codewhale</span>
31 </Link>
32 <p>{chrome.footerTagline}</p>
33 </div>
34
35 <div className="site-footer-links">
36 <div>
37 <span>{chrome.footerProduct}</span>
38 {product.map((item) => <Link key={item.href} href={item.href}>{item.label}</Link>)}
39 </div>
40 <div>
41 <span>{chrome.footerProject}</span>
42 {project.map((item) => <Link key={item.href} href={item.href}>{item.label}</Link>)}
43 </div>
44 </div>
45 </div>
46
47 <div className="site-footer-meta">
48 <p>
49 {chrome.footerCanonicalSource}
50 <a href={REPO_URL}>github.com/Hmbown/CodeWhale</a>
51 {chrome.footerReleases}
52 <a href={REPO_RELEASES_URL}>{chrome.footerReleasesLink}</a>
53 </p>
54 <div>
55 {GITEE_ENABLED && <a href="https://gitee.com/Hmbown/CodeWhale">Gitee</a>}
56 <a href="https://cnb.cool/codewhale.net/codewhale">CNB</a>
57 <a href="https://npmmirror.com/package/codewhale">npmmirror</a>
58 <a href="mailto:hmbown@gmail.com">{chrome.footerSecurity}</a>
59 </div>
60 <span>© {new Date().getFullYear()} Codewhale</span>
61 </div>
62 </footer>
63 );
64 }
65
65 lines Plain Text