"use client"; import { motion } from "framer-motion"; import Image from "next/image"; import Link from "next/link"; import type { Product } from "@/types/saleor"; import { getProductPrice, getProductImage, getLocalizedProduct } from "@/lib/saleor"; interface ProductCardProps { product: Product; index?: number; locale?: string; } export default function ProductCard({ product, index = 0, locale = "SR" }: ProductCardProps) { const image = getProductImage(product); const price = getProductPrice(product); const localized = getLocalizedProduct(product, locale); const isAvailable = product.variants?.[0]?.quantityAvailable > 0; return ( {/* Image Container */}
{image ? ( {localized.name} ) : (
No image
)} {/* Out of Stock Overlay */} {!isAvailable && (
{locale === "EN" ? "Out of Stock" : "Nema na stanju"}
)} {/* Hover Quick Add (optional) */}
{/* Product Info */}

{localized.name}

{price || (locale === "EN" ? "Contact for price" : "Kontaktirajte za cenu")}

); }