Footer.tsx 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. "use client";
  2. import Link from "next/link";
  3. import { Github, Mail, MessageSquare, Users } from "lucide-react";
  4. import { websiteConfig } from "@/lib/website-config";
  5. import { useI18n } from "@/lib/i18n/provider";
  6. interface FooterProps {
  7. /** 首页打开右下角客服小窗;不传则回退为链到首页并带 openChat 参数 */
  8. onOpenChat?: () => void;
  9. }
  10. /**
  11. * 官网底部页脚
  12. */
  13. export function Footer({ onOpenChat }: FooterProps) {
  14. const { t } = useI18n();
  15. return (
  16. <footer className="border-t bg-muted/30">
  17. <div className="container mx-auto px-4 py-12">
  18. <div className="grid grid-cols-1 gap-8 md:grid-cols-4">
  19. <div>
  20. <div className="mb-4 flex items-center space-x-2">
  21. <div className="flex h-8 w-8 items-center justify-center rounded-lg bg-primary">
  22. <span className="text-lg font-bold text-primary-foreground">AI</span>
  23. </div>
  24. <span className="text-lg font-bold">AI-CS</span>
  25. </div>
  26. <p className="mb-4 text-sm text-muted-foreground">{t("footer.blurb")}</p>
  27. <div className="flex items-center space-x-4">
  28. <a
  29. href={websiteConfig.github.repo}
  30. target="_blank"
  31. rel="noopener noreferrer"
  32. className="text-muted-foreground transition-colors hover:text-foreground"
  33. aria-label="GitHub"
  34. >
  35. <Github className="h-5 w-5" />
  36. </a>
  37. </div>
  38. </div>
  39. <div>
  40. <h3 className="mb-4 font-semibold">{t("footer.column.product")}</h3>
  41. <ul className="space-y-2 text-sm">
  42. <li>
  43. <Link
  44. href="#features"
  45. className="text-muted-foreground transition-colors hover:text-foreground"
  46. >
  47. {t("nav.features")}
  48. </Link>
  49. </li>
  50. <li>
  51. <Link
  52. href="#screenshots"
  53. className="text-muted-foreground transition-colors hover:text-foreground"
  54. >
  55. {t("nav.screenshots")}
  56. </Link>
  57. </li>
  58. <li>
  59. <Link
  60. href="#quick-start"
  61. className="text-muted-foreground transition-colors hover:text-foreground"
  62. >
  63. {t("nav.quickStart")}
  64. </Link>
  65. </li>
  66. <li>
  67. <Link
  68. href="/agent/login"
  69. target="_blank"
  70. rel="noopener noreferrer"
  71. className="text-muted-foreground transition-colors hover:text-foreground"
  72. >
  73. {t("nav.agentLogin")}
  74. </Link>
  75. </li>
  76. </ul>
  77. </div>
  78. <div>
  79. <h3 className="mb-4 font-semibold">{t("footer.column.friendLinks")}</h3>
  80. <ul className="space-y-2 text-sm">
  81. {websiteConfig.friendLinks.length > 0 ? (
  82. websiteConfig.friendLinks.map((link, index) => (
  83. <li key={index}>
  84. <a
  85. href={link.url}
  86. target="_blank"
  87. rel="noopener noreferrer"
  88. className="text-muted-foreground transition-colors hover:text-foreground"
  89. >
  90. {link.name}
  91. </a>
  92. </li>
  93. ))
  94. ) : (
  95. <li className="text-xs text-muted-foreground">{t("footer.noFriendLinks")}</li>
  96. )}
  97. </ul>
  98. </div>
  99. <div>
  100. <h3 className="mb-4 font-semibold">{t("footer.column.contact")}</h3>
  101. <ul className="space-y-3 text-sm">
  102. {websiteConfig.contact.email ? (
  103. <li className="flex items-center space-x-2 text-muted-foreground">
  104. <Mail className="h-4 w-4 shrink-0" />
  105. <a
  106. href={`mailto:${websiteConfig.contact.email}`}
  107. aria-label={t("footer.emailLabel")}
  108. className="break-all transition-colors hover:text-foreground"
  109. >
  110. {websiteConfig.contact.email}
  111. </a>
  112. </li>
  113. ) : null}
  114. {websiteConfig.contact.qqGroupNumber ? (
  115. <li className="flex items-center space-x-2 text-muted-foreground">
  116. <Users className="h-4 w-4 shrink-0" />
  117. {websiteConfig.contact.qqGroupJoinUrl ? (
  118. <a
  119. href={websiteConfig.contact.qqGroupJoinUrl}
  120. target="_blank"
  121. rel="noopener noreferrer"
  122. aria-label={t("footer.qqGroupAria")}
  123. className="transition-colors hover:text-foreground"
  124. >
  125. {t("footer.qqGroup")}: {websiteConfig.contact.qqGroupNumber}
  126. </a>
  127. ) : (
  128. <span>
  129. {t("footer.qqGroup")}: {websiteConfig.contact.qqGroupNumber}
  130. </span>
  131. )}
  132. </li>
  133. ) : null}
  134. <li className="flex items-center space-x-2 text-muted-foreground">
  135. <Github className="h-4 w-4" />
  136. <a
  137. href={websiteConfig.github.repo}
  138. target="_blank"
  139. rel="noopener noreferrer"
  140. className="transition-colors hover:text-foreground"
  141. >
  142. GitHub
  143. </a>
  144. </li>
  145. <li className="flex items-center space-x-2 text-muted-foreground">
  146. <MessageSquare className="h-4 w-4 shrink-0" />
  147. {onOpenChat ? (
  148. <button
  149. type="button"
  150. onClick={onOpenChat}
  151. className="text-left transition-colors hover:text-foreground"
  152. >
  153. {t("footer.onlineChat")}
  154. </button>
  155. ) : (
  156. <Link href="/?openChat=1" className="transition-colors hover:text-foreground">
  157. {t("footer.onlineChat")}
  158. </Link>
  159. )}
  160. </li>
  161. </ul>
  162. </div>
  163. </div>
  164. <div className="mt-8 border-t pt-8 text-center text-sm text-muted-foreground">
  165. <p className="mb-2">
  166. © {websiteConfig.copyright.year} {websiteConfig.copyright.company}.{" "}
  167. {t("footer.allRightsReserved")}
  168. </p>
  169. <p>
  170. {t("footer.poweredBy")}{" "}
  171. <a
  172. href={websiteConfig.github.repo}
  173. target="_blank"
  174. rel="noopener noreferrer"
  175. className="hover:text-foreground transition-colors"
  176. >
  177. {t("footer.openSourceLicense")}
  178. </a>
  179. </p>
  180. </div>
  181. </div>
  182. </footer>
  183. );
  184. }