diff --git a/components/product/BuyTogether/AddToCartButton/common.tsx b/components/product/BuyTogether/AddToCartButton/common.tsx index f9fd65b..f1e8f28 100644 --- a/components/product/BuyTogether/AddToCartButton/common.tsx +++ b/components/product/BuyTogether/AddToCartButton/common.tsx @@ -43,7 +43,7 @@ export default function AddToCartButton(props: Props) { return ( diff --git a/components/product/BuyTogether/BuyTogether.tsx b/components/product/BuyTogether/BuyTogether.tsx index 73dbb5d..2b89900 100644 --- a/components/product/BuyTogether/BuyTogether.tsx +++ b/components/product/BuyTogether/BuyTogether.tsx @@ -12,7 +12,9 @@ export interface Props { products: Product[] | null; } -export default function BuyTogether({ products }: Props) { +export default function BuyTogether( + { products }: Props, +) { if (!products || products.length === 0) return null; const othersProducts = useMemo( @@ -26,6 +28,7 @@ export default function BuyTogether({ products }: Props) { () => products.map((item) => item.offers?.lowPrice ?? 0), [products], ); + const totalPrice = useMemo( () => productsOffers.reduce((acc, price) => acc + price, 0), [productsOffers], @@ -50,8 +53,8 @@ export default function BuyTogether({ products }: Props) { return (