import Image, { StaticImageData } from 'next/image'; import clsxm from '@/lib/clsxm'; export const DynamicImage = ({ src: { light, dark }, alt, className = '', ...props }: DynamicImageProps) => { const lightClass = 'dark:!hidden'; const darkClass = '!hidden dark:!block'; const placeholder = typeof light === 'string' ? null : 'blur'; return ( <> {[light, dark].map((src, index) => ( {alt} ))} ); }; export type DynamicImageProps = { src: { light: string | StaticImageData; dark: string | StaticImageData; }; alt: string; className?: string; width?: number; height?: number; [key: string]: any; };