Files
ignum/components/pages/products/productCard.tsx
nabijonovdavronbek619@gmail.com 96acd12d9c catalog part is done
2026-01-30 20:01:56 +05:00

41 lines
1.1 KiB
TypeScript

"use client";
import Image from "next/image";
import Link from "next/link";
interface ProductCardProps {
title: string;
image: string;
slug: string;
}
export default function ProductCard({
title,
image,
slug,
}: ProductCardProps) {
return (
<Link href={`/products/${slug}`}>
<article className="group transition-all duration-300 hover:cursor-pointer max-sm:max-w-100 max-sm:mx-auto max-sm:w-full ">
{/* Image Container */}
<div className="relative rounded-2xl h-45 sm:h-55 md:h-65 lg:w-[95%] w-[90%] mx-auto overflow-hidden">
<Image
src={image || "/placeholder.svg"}
alt={title}
fill
className="object-contain transition-transform duration-300"
/>
</div>
{/* Content Container */}
<div className="p-6 sm:p-4">
{/* Title */}
<h3 className="text-lg text-center sm:text-xl md:text-2xl font-bold text-white mb-4 line-clamp-3 group-hover:text-red-400 transition-colors duration-300">
{title}
</h3>
</div>
</article>
</Link>
);
}