Properly fallback to placeholder

This commit is contained in:
oitsjustjose 2022-04-18 09:10:04 -05:00
commit 882885f65b

View file

@ -9,7 +9,8 @@ import {
} from '@chakra-ui/react';
export default ({ product }) => {
const images = product.images.filter((x) => !!x) || ['https://dv2ls.com/f/PpMcVb8gN'];
const filtered = product.images.filter((x) => !!x);
const images = filtered.length ? filtered : ['https://dv2ls.com/f/PpMcVb8gN'];
return (
<Box
margin="auto"