Skip to content

Commit

Permalink
Do not render when empty, also signifies free
Browse files Browse the repository at this point in the history
  • Loading branch information
dkmyta committed Oct 25, 2024
1 parent dc1f451 commit 7dcc908
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { getThreatIcon, getThreatSubtitle, getThreatType } from './utils';
* @param {Filter[]} props.filters - Current filters value.
* @param {Function} props.onChange - Callback function to update the filter value.
* @param {Array} props.data - Array of threats data with status values.
* @return {JSX.Element} The component.
* @return {JSX.Element|null} The component or null.
*/
export function ThreatsStatusFilter( {
filters,
Expand All @@ -51,6 +51,10 @@ export function ThreatsStatusFilter( {
[ data ]
);

if ( ! ( activeCount && historicCount ) ) {
return null;
}

const isExactStatusSelected = ( statuses: string[] ) =>
filters.some(
filter =>
Expand Down

0 comments on commit 7dcc908

Please sign in to comment.