merged messageImage preview to image preview

This commit is contained in:
Ren Amamiya
2023-04-17 10:47:14 +07:00
parent 0786ad6915
commit 8b67253c0a
7 changed files with 11 additions and 28 deletions

View File

@@ -1,9 +1,11 @@
import Image from 'next/image';
import { memo } from 'react';
export const ImagePreview = memo(function ImagePreview({ url }: { url: string }) {
export const ImagePreview = memo(function ImagePreview({ url, size }: { url: string; size: string }) {
return (
<div className="relative mb-2 mt-3 h-full w-full rounded-lg border border-zinc-800 xl:w-2/3">
<div
className={`relative h-full ${size === 'large' ? 'w-full' : 'w-2/3'} rounded-lg border border-zinc-800 xl:w-2/3`}
>
<Image
src={url}
alt={url}