Footer.tsx 2.3 KB

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