15 lines
664 B
TypeScript
15 lines
664 B
TypeScript
"use client";
|
|
|
|
import Image from "@/components/ui/resilient-image";
|
|
import type { CommentImage } from "@/lib/comments/types";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export function CommentImageView({ image, alt, className, fullSize = false }: {
|
|
image: CommentImage; alt: string; className?: string; fullSize?: boolean;
|
|
}) {
|
|
if (fullSize) return <div className="relative h-[65svh] w-full">
|
|
<Image src={image.url} alt={alt} fill sizes="(min-width: 1024px) 960px, 100vw" className={cn("object-contain", className)} />
|
|
</div>;
|
|
return <Image src={image.url} alt={alt} width={144} height={144} sizes="(min-width: 640px) 144px, 112px" className={className} />;
|
|
}
|