import type { ImageProps } from '@graphcommerce/image'
import { Image } from '@graphcommerce/image'
import { sxx } from '@graphcommerce/next-ui'
import { Trans } from '@lingui/react/macro'
import type { BoxProps } from '@mui/material'
import { Box, Skeleton, styled } from '@mui/material'
const StyledImage = styled(Image)({})
function PlaceHolderContainer(props: BoxProps) {
return (
)
}
export type ProductListItemImageProps = {
aspectRatio?: [number, number]
classes?: {
image?: string
placeholder?: string
}
}
export function ProductListItemImageSkeleton(props: ProductListItemImageProps) {
const { aspectRatio = [4, 3], classes } = props
return (
)
}
export type ImageOrPlaceholderProps = ProductListItemImageProps &
Omit & {
alt?: ImageProps['alt'] | null
src?: ImageProps['src'] | null
}
export function ProductListItemImage(props: ImageOrPlaceholderProps) {
const { aspectRatio = [4, 3], classes, src, alt, sx = [], ...image } = props
if (src) {
return (
)
}
return (
No Image
)
}