"use client"; import Image from "next/image"; export default function ProductDetails({ productItem }) { if (!productItem) { return (

Product not found.

); } const groupedImages = []; for (let i = 0; i < productItem.images.length; i += 2) { groupedImages.push(productItem.images.slice(i, i + 2)); } return (

{productItem.title}

{groupedImages.map((imagePair, index) => (
{imagePair.map((imgSrc, subIndex) => (
{`Product
))}
))}
); }