Footer.tsx 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import { Github, Mail, Twitter } from "lucide-react";
  2. import { getI18n } from "locales/server";
  3. import { TFunction } from "locales/client";
  4. import { Link } from "@/components/ui/link";
  5. const SOCIAL_LINKS = [
  6. {
  7. href: "https://github.com/Snouzy/workout-cool",
  8. icon: Github,
  9. label: "GitHub",
  10. },
  11. {
  12. href: "https://x.com/snouzy_biceps",
  13. icon: Twitter,
  14. label: "Twitter/X",
  15. },
  16. {
  17. href: "mailto:coolworkout6@gmail.com",
  18. icon: Mail,
  19. label: "Email",
  20. },
  21. ];
  22. const NAVIGATION = (t: TFunction) => [
  23. { name: t("commons.donate"), href: "https://ko-fi.com/workoutcool" },
  24. { name: t("commons.about"), href: "/about" },
  25. { name: t("commons.privacy"), href: "/legal/privacy" },
  26. ];
  27. export const Footer = async () => {
  28. const t = await getI18n();
  29. return (
  30. <footer className="border-t border-base-300 dark:border-gray-800 bg-base-100 dark:bg-black px-6 py-4 rounded-b-lg">
  31. <div className="flex flex-col sm:flex-row justify-between items-center gap-4">
  32. {/* Social Icons */}
  33. <div className="flex gap-2">
  34. {SOCIAL_LINKS.map(({ href, icon: Icon, label }) => (
  35. <a
  36. aria-label={label}
  37. className="btn btn-ghost btn-sm btn-circle text-gray-700 dark:text-gray-300 hover:bg-slate-100 dark:hover:bg-gray-800"
  38. href={href}
  39. key={label}
  40. rel="noopener noreferrer"
  41. target="_blank"
  42. >
  43. <Icon className="h-5 w-5" />
  44. </a>
  45. ))}
  46. </div>
  47. {/* Navigation Links */}
  48. <div className="flex flex-col sm:flex-row gap-2 sm:gap-4 text-center text-gray-700 dark:text-gray-300">
  49. {NAVIGATION(t).map(({ name, href }) => (
  50. <Link
  51. className="hover:underline hover:text-blue-500 dark:hover:text-blue-400"
  52. href={href}
  53. key={name}
  54. size="sm"
  55. variant="footer"
  56. {...(href.startsWith("http") && { target: "_blank", rel: "noopener noreferrer" })}
  57. >
  58. {name}
  59. </Link>
  60. ))}
  61. </div>
  62. </div>
  63. </footer>
  64. );
  65. };