import React, { forwardRef } from 'react' import type { HTMLAttributes } from 'react' export interface CartItemSummaryProps extends HTMLAttributes { /** * ID to find this component in testing tools (e.g.: Cypress, Testing Library, and Jest). */ testId?: string /** * Specifies the product's title. */ title: string /** * Array of the product's chosen variations. */ activeVariations?: Array<{ label: string; option: string }> } const CartItemSummary = forwardRef( function CartItemSummary( { testId = 'fs-cart-item-summary', title, activeVariations = [], children, ...otherProps }, ref ) { return (
{title}
{activeVariations.length > 0 && (
{activeVariations.map(({ label, option }) => (

{label}: {option}

))}
)} {children}
) } ) export default CartItemSummary