diff options
| author | Saumit <justsaumit@protonmail.com> | 2025-09-27 02:14:26 +0530 |
|---|---|---|
| committer | Saumit <justsaumit@protonmail.com> | 2025-09-27 02:14:26 +0530 |
| commit | 82e03978b89938219958032efb1448cc76baa181 (patch) | |
| tree | 626f3e54d52ecd49be0ed3bee30abacc0453d081 /src/frontend/components/CartItems/CartItem.tsx | |
Initial snapshot - OpenTelemetry demo 2.1.3 -f
Diffstat (limited to 'src/frontend/components/CartItems/CartItem.tsx')
| -rw-r--r-- | src/frontend/components/CartItems/CartItem.tsx | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/frontend/components/CartItems/CartItem.tsx b/src/frontend/components/CartItems/CartItem.tsx new file mode 100644 index 0000000..e78bb7a --- /dev/null +++ b/src/frontend/components/CartItems/CartItem.tsx @@ -0,0 +1,40 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import Link from 'next/link'; +import { Product } from '../../protos/demo'; +import ProductPrice from '../ProductPrice'; +import * as S from './CartItems.styled'; + +interface IProps { + product: Product; + quantity: number; +} + +const CartItem = ({ + product: { id, name, picture, priceUsd = { units: 0, nanos: 0, currencyCode: 'USD' } }, + quantity, +}: IProps) => { + return ( + <S.CartItem> + <Link href={`/product/${id}`}> + <S.NameContainer> + <S.CartItemImage alt={name} src={"/images/products/" + picture} /> + <p>{name}</p> + </S.NameContainer> + </Link> + <S.CartItemDetails> + <p>{quantity}</p> + </S.CartItemDetails> + <S.CartItemDetails> + <S.PriceContainer> + <p> + <ProductPrice price={priceUsd} /> + </p> + </S.PriceContainer> + </S.CartItemDetails> + </S.CartItem> + ); +}; + +export default CartItem; |
