Sacha VAUDEY 7e47c6163d
Some checks failed
Build and Test / Classic Build (pull_request) Failing after 55s
Build and Test / Docker Build (pull_request) Has been skipped
fix
2025-09-14 14:43:01 +02:00

152 lines
5.5 KiB
TypeScript

import React from 'react';
import { URLS, SITE_CONFIG } from '@/lib/config/constants';
import { BookOpen, GitBranch, Gamepad2, Cloud, Rocket, Heart } from 'lucide-react';
import { useTranslation } from '@/lib/hooks/useTranslation';
import { cn, commonClasses } from '@/lib/utils';
import { DiscordIcon } from '@/components/ui/DiscordLogo';
const EmailIcon = () => (
<svg className="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M3 8l7.89 4.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" />
</svg>
);
// Composant pour les liens de service factorisant la structure répétitive
interface ServiceLinkProps {
href: string;
icon: React.ComponentType<any>;
children: React.ReactNode;
}
const ServiceLink: React.FC<ServiceLinkProps> = ({ href, icon: Icon, children }) => (
<a
href={href}
className={cn(
'flex items-center text-gray-300 hover:text-blue-400',
commonClasses.transition,
'hover:translate-x-2 transform'
)}
>
<Icon className="w-5 h-5 mr-3" strokeWidth={2} />
{children}
</a>
);
// Composant pour les boutons sociaux factorisant la structure répétitive
interface SocialButtonProps {
href: string;
label: string;
children: React.ReactNode;
}
const SocialButton: React.FC<SocialButtonProps> = ({ href, label, children }) => (
<a
href={href}
className={cn(
'w-12 h-12 bg-gray-800 hover:bg-blue-600 rounded-xl',
'flex items-center justify-center',
commonClasses.transition,
commonClasses.hoverScale,
'shadow-lg hover:shadow-blue-500/25'
)}
aria-label={label}
>
{children}
</a>
);
export const Footer: React.FC = () => {
const { t } = useTranslation();
return (
<footer className="bg-gray-900 text-white py-16 px-4 sm:px-6 lg:px-8 border-t border-gray-800">
<div className="max-w-7xl mx-auto">
{/* Contenu principal du footer */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-12 mb-12">
{/* Marque et description */}
<div className="space-y-6">
<div className="flex items-center gap-4">
<div className="w-12 h-12 bg-gradient-to-br from-blue-500 to-blue-600 rounded-xl flex items-center justify-center shadow-lg">
<span className="text-white font-bold text-xl">B</span>
</div>
<span className="text-white font-bold text-2xl">
{SITE_CONFIG.name}
</span>
</div>
<p className="text-gray-300 leading-relaxed">
{t.footer.description}
</p>
{/* Réseaux sociaux */}
<div className="flex items-center gap-4">
<SocialButton href={URLS.social.discord} label="Discord">
<DiscordIcon />
</SocialButton>
<SocialButton href={URLS.contact.email} label="Email">
<EmailIcon />
</SocialButton>
</div>
</div>
{/* Liens rapides services */}
<div className="space-y-6">
<h3 className="text-white font-bold text-lg mb-6">{t.footer.ourServices}</h3>
<div className="space-y-4">
<ServiceLink href={URLS.services.wiki} icon={BookOpen}>
Wiki
</ServiceLink>
<ServiceLink href={URLS.services.gitea} icon={GitBranch}>
Gitea
</ServiceLink>
<ServiceLink href={URLS.services.panel} icon={Gamepad2}>
{t.footer.gamingPanel}
</ServiceLink>
<ServiceLink href={URLS.services.opencloud} icon={Cloud}>
OpenCloud
</ServiceLink>
</div>
</div>
{/* Informations communauté */}
<div className="space-y-6">
<h3 className="text-white font-bold text-lg mb-6">{t.footer.community}</h3>
<div className="bg-gradient-to-r from-blue-900/30 to-blue-800/30 rounded-xl p-6 border border-blue-800/30">
<h4 className="text-blue-400 font-semibold mb-2">{t.footer.joinAssociation}</h4>
<p className="text-gray-300 text-sm mb-4">
{t.footer.joinDescription}
</p>
<a
href={URLS.social.discord}
className={cn(
'inline-flex items-center text-blue-400 hover:text-blue-300',
'text-sm font-semibold',
commonClasses.transition
)}
>
<Rocket className="w-4 h-4 mr-2" strokeWidth={2} />
{t.footer.joinNow}
</a>
</div>
</div>
</div>
{/* Barre du bas */}
<div className="flex flex-col md:flex-row justify-between items-center gap-6 pt-8 border-t border-gray-800">
<p className="text-gray-400 text-sm text-center md:text-left">
© 2025 {SITE_CONFIG.name}. {t.footer.copyright}
</p>
<div className="flex items-center gap-6 text-sm text-gray-400">
<span className="flex items-center">
{t.footer.madeWith}
<Heart className="text-red-500 mx-1 w-4 h-4" strokeWidth={2} fill="currentColor" />
{t.footer.by}
</span>
<div className="w-1 h-1 bg-gray-600 rounded-full"></div>
<span className="text-blue-400 font-semibold">EPITA 2025</span>
</div>
</div>
</div>
</footer>
);
};