import { LazyLoadImage } from 'react-lazy-load-image-component'; import { Box } from '@mui/material'; import clsx from 'clsx'; import { isFunction } from 'lodash'; import useDefaultProps from '../../hooks/useDefaultProps'; import imageClasses from './classes'; import ImageWrapper from './ImageWrapper'; import Overlay from './Overlay'; import { defaultPlaceholder, defaultTransparentPlaceholder } from './placeholders'; import { ImageProps } from './types'; export default function Image(inProps: ImageProps) { const { ref, aspectRatio, disabledEffect = false, alt, src, delayTime, threshold, beforeLoad, delayMethod, placeholder, wrapperProps, scrollPosition, effect = 'blur', visibleByDefault, wrapperClassName, useIntersectionObserver, width, height, slotProps, sx, srcSet, placeholderSrc, objectFit = 'cover', className, ...other } = useDefaultProps({ name: 'ReevolveImage', props: inProps }); return ( ({ width, height, ...(!!aspectRatio && { width: width ?? 1 }), ...(isFunction(sx) ? (sx as Function)(theme) : sx) })} > {slotProps?.overlay && ( )} ({ width: 1, height: 1, objectFit, aspectRatio, ...(isFunction(slotProps?.img?.sx) ? (slotProps.img.sx as Function)(theme) : slotProps?.img?.sx) })} /> ); }