2019-12-03 13:39:11 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __, sprintf } from '@wordpress/i18n';
|
2020-07-10 09:09:49 +00:00
|
|
|
import { RemovableChip } from '@woocommerce/base-components/chip';
|
2019-12-03 13:39:11 +00:00
|
|
|
|
|
|
|
const DropdownSelectorSelectedChip = ( { onRemoveItem, option } ) => {
|
|
|
|
return (
|
2020-07-10 09:09:49 +00:00
|
|
|
<RemovableChip
|
2020-06-17 09:53:42 +00:00
|
|
|
className="wc-block-dropdown-selector__selected-chip wc-block-components-dropdown-selector__selected-chip"
|
2020-07-10 09:09:49 +00:00
|
|
|
removeOnAnyClick={ true }
|
|
|
|
onRemove={ () => {
|
2019-12-03 13:39:11 +00:00
|
|
|
onRemoveItem( option.value );
|
|
|
|
} }
|
2020-07-10 09:09:49 +00:00
|
|
|
ariaLabel={ sprintf(
|
2021-02-19 11:58:44 +00:00
|
|
|
/* translators: %s is referring to the filter option being removed. */
|
2019-12-03 13:39:11 +00:00
|
|
|
__( 'Remove %s filter', 'woo-gutenberg-products-block' ),
|
|
|
|
option.name
|
|
|
|
) }
|
2020-07-10 09:09:49 +00:00
|
|
|
text={ option.label }
|
|
|
|
radius="large"
|
|
|
|
/>
|
2019-12-03 13:39:11 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default DropdownSelectorSelectedChip;
|