import { extendableComponent, ListFormat } from '@graphcommerce/next-ui' import { Box } from '@mui/material' import type { ProductSpecsFragment } from './ProductSpecs.gql' const name = 'ProductSpecs' const parts = ['root', 'specs', 'options'] as const const { classes } = extendableComponent(name, parts) export type ProductSpecsCustomAttributesProps = Pick export function ProductSpecsCustomAttributes(props: ProductSpecsCustomAttributesProps) { const { items } = props const specs = items?.[0]?.custom_attributesV2?.items if (items?.length === 0) return null return ( <> {specs?.map((item) => (
  • {item?.attribute?.label}
    {item?.__typename === 'AttributeSelectedOptions' && ( {item?.selected_options?.map((option) => ( {option?.label === '1' ? 'Yes' : option?.label} ))} )} {item?.__typename === 'AttributeValue' && {item.value}}
  • ))} ) }