All files / src/shared/components/FiltersPanel FiltersPanelHeader.tsx

100% Statements 19/19
100% Branches 1/1
100% Functions 1/1
100% Lines 19/19

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 291x 1x           1x 31x   31x 31x 31x 31x 31x 31x 31x 31x 31x 31x   31x 31x 31x   31x   1x  
import { useFallbackTranslation } from '@/hooks/useFallbackTranslation';
import Button, { ButtonVariant } from '@/shared/components/button/Button';
 
interface Props {
  onClear: () => void;
}
 
const FiltersPanelHeader = ({ onClear }: Props) => {
  const { t } = useFallbackTranslation();
 
  return (
    <div className="filters-panel__header">
      <h3 id="filters-panel-heading"> {t('common.filtersPanel.filters')}</h3>
      <Button
        className="clear-btn"
        aria-label="Clear Button"
        data-testid="clear-btn"
        variant={ButtonVariant.SECONDARY}
        size="xs"
        handleClick={onClear}
      >
        {t('common.buttons.clearFilters')}
      </Button>
    </div>
  );
};
 
export default FiltersPanelHeader;