import React from 'react' import { Button, Label } from '../..' import { useProductComparison } from '../../hooks/useProductComparison' import type { ImageComponentType } from './ProductComparisonSidebar' export interface ProductComparisonToolbarProps { /* * Set the label for the warning message when products are selected. */ selectionWarningLabel?: string /* * Set the label for the compare button */ compareButtonLabel?: string /* * Set the label for the clear selection button */ clearSelectionButtonLabel?: string } const ImageComponent: ImageComponentType = ({ src, alt, ...otherProps }) => ( {alt} ) function ProductComparisonToolbar({ clearSelectionButtonLabel, compareButtonLabel, selectionWarningLabel, }: ProductComparisonToolbarProps) { const { isOpen, setIsOpen, products, clearProducts } = useProductComparison() const selectedProductsDisplay = products.slice(0, 3) if (!products.length && isOpen) return null return ( ) } export default ProductComparisonToolbar