From 82e03978b89938219958032efb1448cc76baa181 Mon Sep 17 00:00:00 2001 From: Saumit Date: Sat, 27 Sep 2025 02:14:26 +0530 Subject: Initial snapshot - OpenTelemetry demo 2.1.3 -f --- .../components/CheckoutItem/CheckoutItem.tsx | 61 ++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/frontend/components/CheckoutItem/CheckoutItem.tsx (limited to 'src/frontend/components/CheckoutItem/CheckoutItem.tsx') diff --git a/src/frontend/components/CheckoutItem/CheckoutItem.tsx b/src/frontend/components/CheckoutItem/CheckoutItem.tsx new file mode 100644 index 0000000..8fd0ecf --- /dev/null +++ b/src/frontend/components/CheckoutItem/CheckoutItem.tsx @@ -0,0 +1,61 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +import Image from 'next/image'; +import { useState } from 'react'; +import { CypressFields } from '../../utils/enums/CypressFields'; +import { Address } from '../../protos/demo'; +import { IProductCheckoutItem } from '../../types/Cart'; +import ProductPrice from '../ProductPrice'; +import * as S from './CheckoutItem.styled'; + +interface IProps { + checkoutItem: IProductCheckoutItem; + address: Address; +} + +const CheckoutItem = ({ + checkoutItem: { + item: { + quantity, + product: { picture, name }, + }, + cost = { currencyCode: 'USD', units: 0, nanos: 0 }, + }, + address: { streetAddress = '', city = '', state = '', zipCode = '', country = '' }, +}: IProps) => { + const [isCollapsed, setIsCollapsed] = useState(false); + + return ( + + + + + {name} +

Quantity: {quantity}

+

+ Total: +

+
+
+ + Shipping Data +

Street: {streetAddress}

+ {!isCollapsed && setIsCollapsed(true)}>See More} + {isCollapsed && ( + <> +

City: {city}

+

State: {state}

+

Zip Code: {zipCode}

+

Country: {country}

+ + )} +
+ + check Done + +
+ ); +}; + +export default CheckoutItem; -- cgit v1.2.3