import React, { FC, PropsWithChildren } from 'react' import Image from 'next/image' import ImageListItemBar from '@mui/material/ImageListItemBar' import { getOriginalImageDimensions, getRootImageUrl, getVwByColCount } from '../../utils/imageServices' import { LmImageListItemProps } from './imageListTypes' import { COLUMN_COUNT } from '../card/cardListStyles' import { storyblokImageLoader } from '../../utils/storyblokImageLoader' import { useTheme } from '@mui/material/styles' import Box from '@mui/material/Box' const ImageWrap: FC< PropsWithChildren<{ fitInColor?: string respectImgRatio?: boolean }> > = ({ respectImgRatio, children, fitInColor }) => { if (!fitInColor || respectImgRatio) { return <>{children} } return ( {children} ) } export default function LmImageListItem({ content, listProps }: LmImageListItemProps): JSX.Element { const theme = useTheme() // const { classes, theme } = useStyles() const imageSource = getRootImageUrl(content.source || '') const originalDimensions = getOriginalImageDimensions(content.source || '') const { breakpoints } = theme const { width } = originalDimensions const { height } = originalDimensions const respectImgRatio = listProps.masonry || listProps.variant === 'masonry' || !listProps.aspect_ratio const { column_count, column_count_phone, column_count_tablet } = listProps const phoneVw = getVwByColCount(column_count_phone || COLUMN_COUNT.PHONE) const tabletVw = getVwByColCount( column_count_tablet || column_count || COLUMN_COUNT.TABLET ) const desktopVw = getVwByColCount(column_count || COLUMN_COUNT.DESKTOP) return ( {content.alt {(content.label || content.sub_title) && ( )} ) }