Footer.tsx 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. 'use client';
  2. import Link from 'next/link';
  3. import { usePathname } from 'next/navigation';
  4. import { Plane } from 'lucide-react';
  5. import { useLanguage } from '@/lib/i18n/LanguageContext';
  6. export default function Footer() {
  7. const pathname = usePathname();
  8. const { t } = useLanguage();
  9. const currentYear = new Date().getFullYear();
  10. // 后台管理页面隐藏 Footer
  11. if (pathname?.startsWith('/admin')) {
  12. return null;
  13. }
  14. return (
  15. <footer className="bg-white border-t border-slate-200 py-8 md:py-12 mt-auto">
  16. <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
  17. {/*
  18. Grid 布局调整:
  19. - 移动端:grid-cols-2 (2列)
  20. - 桌面端:md:grid-cols-4 (4列)
  21. */}
  22. <div className="grid grid-cols-2 md:grid-cols-4 gap-8 mb-8 md:mb-12">
  23. {/* Brand - 移动端跨2列居中,桌面端跨2列左对齐 */}
  24. <div className="col-span-2 text-center md:text-left">
  25. <div className="flex items-center justify-center md:justify-start gap-2 mb-4">
  26. <Plane className="text-blue-600" size={24} />
  27. <span className="text-xl font-bold text-slate-900">TextSkin</span>
  28. </div>
  29. <p className="text-sm text-slate-500 max-w-xs mx-auto md:mx-0 leading-relaxed">
  30. {t('footer.description')}
  31. </p>
  32. </div>
  33. {/* Quick Links - 移动端占1列 */}
  34. <div className="col-span-1 pl-4 md:pl-0">
  35. <h4 className="font-bold text-slate-900 mb-4 text-sm md:text-base">{t('footer.quick_links')}</h4>
  36. <ul className="space-y-3 text-sm text-slate-600">
  37. <li><Link href="/services" className="hover:text-blue-600 transition block py-1">{t('nav.services')}</Link></li>
  38. <li><Link href="/slots" className="hover:text-blue-600 transition block py-1">{t('nav.slots')}</Link></li>
  39. <li><Link href="/dashboard" className="hover:text-blue-600 transition block py-1">{t('nav.dashboard')}</Link></li>
  40. </ul>
  41. </div>
  42. {/* Support - 移动端占1列 */}
  43. <div className="col-span-1 pl-4 md:pl-0">
  44. <h4 className="font-bold text-slate-900 mb-4 text-sm md:text-base">{t('footer.support')}</h4>
  45. <ul className="space-y-3 text-sm text-slate-600">
  46. <li><Link href="/refund-policy" className="hover:text-blue-600 transition block py-1">{t('footer.refund_policy')}</Link></li>
  47. <li><Link href="/terms" className="hover:text-blue-600 transition block py-1">{t('footer.terms')}</Link></li>
  48. <li><Link href="/contact" className="hover:text-blue-600 transition block py-1">{t('footer.contact')}</Link></li>
  49. </ul>
  50. </div>
  51. </div>
  52. {/* Bottom Bar - 移动端垂直排列,桌面端水平两端对齐 */}
  53. <div className="border-t border-slate-100 pt-8 flex flex-col md:flex-row justify-between items-center text-xs text-slate-400 gap-4 md:gap-0">
  54. <p className="text-center md:text-left">
  55. &copy; {currentYear} TextSkin Inc. {t('footer.rights_reserved')}
  56. </p>
  57. <div className="flex gap-6 md:gap-4">
  58. <Link href="/privacy" className="hover:text-slate-600 transition p-2 md:p-0">{t('footer.privacy')}</Link>
  59. <Link href="/cookie-policy" className="hover:text-slate-600 transition p-2 md:p-0">{t('footer.cookie')}</Link>
  60. </div>
  61. </div>
  62. </div>
  63. </footer>
  64. );
  65. }