'use client' import { useState } from 'react' import NextImage, { type ImageProps as NextImageProps } from 'next/image' import { cn } from '@/lib/utils' import { Lightbox } from './lightbox' interface ImageProps extends Omit { className?: string enableLightbox?: boolean } export function Image({ className = 'w-full', enableLightbox = true, alt = '', src, ...props }: ImageProps) { const [isLightboxOpen, setIsLightboxOpen] = useState(false) const handleImageClick = () => { if (enableLightbox) { setIsLightboxOpen(true) } } return ( <> {enableLightbox && ( setIsLightboxOpen(false)} src={typeof src === 'string' ? src : String(src)} alt={alt} type='image' /> )} ) }