mirror of
https://github.com/vercel/commerce.git
synced 2025-05-12 20:57:51 +00:00
27 lines
564 B
TypeScript
27 lines
564 B
TypeScript
import { getImage } from 'lib/shopify';
|
|
import Image from 'next/image';
|
|
import { twMerge } from 'tailwind-merge';
|
|
|
|
const ImageDisplay = async ({
|
|
fileId,
|
|
title,
|
|
className
|
|
}: {
|
|
fileId: string;
|
|
title: string;
|
|
className?: string;
|
|
}) => {
|
|
const image = await getImage(fileId);
|
|
return (
|
|
<Image
|
|
src={image.url}
|
|
alt={image.altText || `Display Image for ${title} section`}
|
|
width={image.width}
|
|
height={image.height}
|
|
className={twMerge('h-full w-full object-contain', className)}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default ImageDisplay;
|