| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- "use client";
- import Link from "next/link";
- import { Github, Mail, MessageSquare, Users } from "lucide-react";
- import { websiteConfig } from "@/lib/website-config";
- import { useI18n } from "@/lib/i18n/provider";
- interface FooterProps {
- /** 首页打开右下角客服小窗;不传则回退为链到首页并带 openChat 参数 */
- onOpenChat?: () => void;
- }
- /**
- * 官网底部页脚
- */
- export function Footer({ onOpenChat }: FooterProps) {
- const { t } = useI18n();
- return (
- <footer className="border-t bg-muted/30">
- <div className="container mx-auto px-4 py-12">
- <div className="grid grid-cols-1 gap-8 md:grid-cols-4">
- <div>
- <div className="mb-4 flex items-center space-x-2">
- <div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary">
- <span className="text-lg font-bold text-primary-foreground">AI</span>
- </div>
- <span className="text-lg font-bold">AI-CS</span>
- </div>
- <p className="mb-4 text-sm text-muted-foreground">{t("footer.blurb")}</p>
- <div className="flex items-center space-x-4">
- <a
- href={websiteConfig.github.repo}
- target="_blank"
- rel="noopener noreferrer"
- className="text-muted-foreground transition-colors hover:text-foreground"
- aria-label="GitHub"
- >
- <Github className="h-5 w-5" />
- </a>
- </div>
- </div>
- <div>
- <h3 className="mb-4 font-semibold">{t("footer.column.product")}</h3>
- <ul className="space-y-2 text-sm">
- <li>
- <Link
- href="#features"
- className="text-muted-foreground transition-colors hover:text-foreground"
- >
- {t("nav.features")}
- </Link>
- </li>
- <li>
- <Link
- href="#screenshots"
- className="text-muted-foreground transition-colors hover:text-foreground"
- >
- {t("nav.screenshots")}
- </Link>
- </li>
- <li>
- <Link
- href="#quick-start"
- className="text-muted-foreground transition-colors hover:text-foreground"
- >
- {t("nav.quickStart")}
- </Link>
- </li>
- <li>
- <Link
- href="/agent/login"
- target="_blank"
- rel="noopener noreferrer"
- className="text-muted-foreground transition-colors hover:text-foreground"
- >
- {t("nav.agentLogin")}
- </Link>
- </li>
- </ul>
- </div>
- <div>
- <h3 className="mb-4 font-semibold">{t("footer.column.friendLinks")}</h3>
- <ul className="space-y-2 text-sm">
- {websiteConfig.friendLinks.length > 0 ? (
- websiteConfig.friendLinks.map((link, index) => (
- <li key={index}>
- <a
- href={link.url}
- target="_blank"
- rel="noopener noreferrer"
- className="text-muted-foreground transition-colors hover:text-foreground"
- >
- {link.name}
- </a>
- </li>
- ))
- ) : (
- <li className="text-xs text-muted-foreground">{t("footer.noFriendLinks")}</li>
- )}
- </ul>
- </div>
- <div>
- <h3 className="mb-4 font-semibold">{t("footer.column.contact")}</h3>
- <ul className="space-y-3 text-sm">
- {websiteConfig.contact.email ? (
- <li className="flex items-center space-x-2 text-muted-foreground">
- <Mail className="h-4 w-4 shrink-0" />
- <a
- href={`mailto:${websiteConfig.contact.email}`}
- aria-label={t("footer.emailLabel")}
- className="break-all transition-colors hover:text-foreground"
- >
- {websiteConfig.contact.email}
- </a>
- </li>
- ) : null}
- {websiteConfig.contact.qqGroupNumber ? (
- <li className="flex items-center space-x-2 text-muted-foreground">
- <Users className="h-4 w-4 shrink-0" />
- {websiteConfig.contact.qqGroupJoinUrl ? (
- <a
- href={websiteConfig.contact.qqGroupJoinUrl}
- target="_blank"
- rel="noopener noreferrer"
- aria-label={t("footer.qqGroupAria")}
- className="transition-colors hover:text-foreground"
- >
- {t("footer.qqGroup")}: {websiteConfig.contact.qqGroupNumber}
- </a>
- ) : (
- <span>
- {t("footer.qqGroup")}: {websiteConfig.contact.qqGroupNumber}
- </span>
- )}
- </li>
- ) : null}
- <li className="flex items-center space-x-2 text-muted-foreground">
- <Github className="h-4 w-4" />
- <a
- href={websiteConfig.github.repo}
- target="_blank"
- rel="noopener noreferrer"
- className="transition-colors hover:text-foreground"
- >
- GitHub
- </a>
- </li>
- <li className="flex items-center space-x-2 text-muted-foreground">
- <MessageSquare className="h-4 w-4 shrink-0" />
- {onOpenChat ? (
- <button
- type="button"
- onClick={onOpenChat}
- className="text-left transition-colors hover:text-foreground"
- >
- {t("footer.onlineChat")}
- </button>
- ) : (
- <Link href="/?openChat=1" className="transition-colors hover:text-foreground">
- {t("footer.onlineChat")}
- </Link>
- )}
- </li>
- </ul>
- </div>
- </div>
- <div className="mt-8 border-t pt-8 text-center text-sm text-muted-foreground">
- <p className="mb-2">
- © {websiteConfig.copyright.year} {websiteConfig.copyright.company}.{" "}
- {t("footer.allRightsReserved")}
- </p>
- <p>
- {t("footer.poweredBy")}{" "}
- <a
- href={websiteConfig.github.repo}
- target="_blank"
- rel="noopener noreferrer"
- className="hover:text-foreground transition-colors"
- >
- {t("footer.openSourceLicense")}
- </a>
- </p>
- </div>
- </div>
- </footer>
- );
- }
|