commerce/components/page/image-display.tsx
Chloe a1d65a54c1
feat: implement text/image-with-text/icon-with-text content block
Signed-off-by: Chloe <pinkcloudvnn@gmail.com>
2024-05-23 14:17:55 +07:00

18 lines
456 B
TypeScript

import { getImage } from 'lib/shopify';
import Image from 'next/image';
const ImageDisplay = async ({ fileId, title }: { fileId: string; title: 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="h-full w-full object-contain"
/>
);
};
export default ImageDisplay;