2021-10-29 02:35:17 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2022-02-01 16:54:38 +00:00
|
|
|
import { miniCart } from '@woocommerce/icons';
|
|
|
|
import { Icon } from '@wordpress/icons';
|
2021-10-29 02:35:17 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import './style.scss';
|
|
|
|
|
2021-11-17 15:39:07 +00:00
|
|
|
interface Props {
|
|
|
|
count: number;
|
|
|
|
colorClassNames?: string;
|
|
|
|
}
|
|
|
|
|
2023-03-02 14:08:09 +00:00
|
|
|
const QuantityBadge = ( { count }: Props ): JSX.Element => {
|
2021-11-17 15:39:07 +00:00
|
|
|
return (
|
|
|
|
<span className="wc-block-mini-cart__quantity-badge">
|
|
|
|
<Icon
|
|
|
|
className="wc-block-mini-cart__icon"
|
|
|
|
size={ 20 }
|
2022-02-01 16:54:38 +00:00
|
|
|
icon={ miniCart }
|
2021-11-17 15:39:07 +00:00
|
|
|
/>
|
2023-03-02 14:08:09 +00:00
|
|
|
<span className="wc-block-mini-cart__badge">{ count }</span>
|
2021-11-17 15:39:07 +00:00
|
|
|
</span>
|
|
|
|
);
|
|
|
|
};
|
2021-10-29 02:35:17 +00:00
|
|
|
|
|
|
|
export default QuantityBadge;
|