63 lines
2.5 KiB
TypeScript
63 lines
2.5 KiB
TypeScript
import React from 'react';
|
|
import Image from 'next/image'
|
|
import type { Service } from '@/types/service';
|
|
|
|
interface ServiceCardProps {
|
|
service: Service;
|
|
onServiceClick: (service: Service) => void;
|
|
className?: string;
|
|
}
|
|
|
|
export const ServiceCard: React.FC<ServiceCardProps> = ({
|
|
service,
|
|
onServiceClick,
|
|
className = '',
|
|
}) => {
|
|
const handleClick = () => {
|
|
onServiceClick(service);
|
|
};
|
|
|
|
return (
|
|
<div
|
|
className={`group relative p-8 bg-white rounded-2xl shadow-lg hover:shadow-2xl border border-gray-200 hover:border-blue-300 transition-all duration-300 cursor-pointer transform hover:-translate-y-4 hover:scale-105 active:scale-95 ${className}`}
|
|
onClick={handleClick}
|
|
>
|
|
{/* Indicateur de survol */}
|
|
<div className="absolute inset-0 bg-gradient-to-br from-blue-50/50 to-indigo-50/50 rounded-2xl opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
|
|
|
|
{/* Contenu de la carte */}
|
|
<div className="relative z-10">
|
|
{/* Icône du service */}
|
|
<div className="mb-8 w-24 h-24 rounded-2xl bg-gradient-to-br from-blue-500 to-blue-600 flex items-center justify-center shadow-xl group-hover:shadow-2xl group-hover:scale-110 transition-all duration-300 mx-auto">
|
|
<Image
|
|
src={service.image as any}
|
|
alt={service.icon}
|
|
className="h-12 w-12 transition-transform duration-300 group-hover:scale-110"
|
|
width={48}
|
|
height={48}
|
|
/>
|
|
</div>
|
|
|
|
{/* Nom du service */}
|
|
<h3 className="text-xl md:text-2xl font-bold mb-4 text-gray-900 text-center group-hover:text-blue-700 transition-colors duration-300">
|
|
{service.name}
|
|
</h3>
|
|
|
|
{/* Description courte */}
|
|
<p className="text-gray-600 leading-relaxed text-center group-hover:text-gray-700 transition-colors duration-300">
|
|
{service.description.split('.')[0]}.
|
|
</p>
|
|
|
|
{/* Flèche indicatrice au hover */}
|
|
<div className="mt-6 flex justify-center opacity-0 group-hover:opacity-100 transition-all duration-300 transform translate-y-2 group-hover:translate-y-0">
|
|
<div className="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center shadow-lg">
|
|
<svg className="w-4 h-4 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M9 5l7 7-7 7" />
|
|
</svg>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|