import ProductCard from "@/features/home/components/ProductCard"; import {useTranslations} from "next-intl"; interface RelatedProduct { id: number; slug: string; name: string; price_amount: string; old_price_amount?: string; struct_price_text: string; discount?: number | null; discount_text?: string | null; stock?: number; media: Array<{ images_800x800?: string; images_720x720?: string; images_400x400?: string; thumbnail: string; }>; labels?: Array<{ text: string; bg_color: string; }>; price_color?: string; } interface RelatedProductsSectionProps { products: RelatedProduct[]; } export function RelatedProductsSection({ products, }: RelatedProductsSectionProps) { const t = useTranslations(); if (!products || products.length === 0) return null; return (

{t("related_products")}

{products.slice(0, 4).map((product) => { const images = product.media?.map( (m) => m.images_800x800 || m.images_720x720 || m.images_400x400 || m.thumbnail ) || []; return ( ); })}
); }