import Prose from 'components/prose'; import { Product } from 'lib/shopify/types'; import Image from 'next/image'; export function ProductTastingNotes({ product }: { product: Product }) { const notes = product?.notes?.value; const imageUrl = product?.notesImage?.reference?.image?.url; const imageWidth = product?.notesImage?.reference?.image?.width; const imageHeight = product?.notesImage?.reference?.image?.height; const imageAlt = product?.notesImage?.reference?.image?.altText; if (!imageUrl && !imageWidth && !imageHeight) { return null; } return (
{!!notes ? (
) : null} {imageUrl && imageHeight && imageWidth && (
{imageAlt
)}
); }