"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 && ( {localized.name} )} {!isAvailable && (
{locale === "en" ? "Out of Stock" : "Nema na stanju"}
)}

{localized.name}

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

); }