diff --git a/components/store/purchase/ItemCard.tsx b/components/store/purchase/ItemCard.tsx index 0ce15994c..f23a6dab3 100644 --- a/components/store/purchase/ItemCard.tsx +++ b/components/store/purchase/ItemCard.tsx @@ -1,4 +1,5 @@ import Image from 'next/image'; +import { SyntheticEvent } from 'react'; import { useSetRecoilState } from 'recoil'; import { Item } from 'types/itemTypes'; import { Modal } from 'types/modalTypes'; @@ -30,6 +31,10 @@ export default function ItemCard({ item }: { item: Item }) { }); }; + const handleImageError = (e: SyntheticEvent) => { + e.currentTarget.src = '/image/not_found.svg'; + }; + return (
{item.discount > 0 && ( @@ -38,11 +43,12 @@ export default function ItemCard({ item }: { item: Item }) {
- {item.imageUri ? ( - {item.itemName} - ) : ( - {'not_found'} - )} + {item.itemName}
{item.itemName}
@@ -51,10 +57,12 @@ export default function ItemCard({ item }: { item: Item }) { 0 ? styles.onDiscount : styles.salePrice} > - {item.originalPrice} + {item.originalPrice.toLocaleString()} {item.discount > 0 && ( - {item.salePrice} + + {item.salePrice.toLocaleString()} + )}
{item.mainContent}