mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-14 04:55:55 +08:00
feat: condition is updated
This commit is contained in:
parent
88d8dba90e
commit
1e980c3886
@ -39,6 +39,10 @@ function CommonCheckBox(props: CommonCheckBoxProps): JSX.Element {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const isMoreButtonAvilable = Boolean(
|
||||||
|
numberOfFilters && statusObj.length > numberOfFilters,
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{statusObj.length > 0 && (
|
{statusObj.length > 0 && (
|
||||||
@ -62,13 +66,15 @@ function CommonCheckBox(props: CommonCheckBoxProps): JSX.Element {
|
|||||||
}
|
}
|
||||||
return countA - countB;
|
return countA - countB;
|
||||||
})
|
})
|
||||||
.filter((_, index) => index < numberOfFilters)
|
|
||||||
.filter((filter) => {
|
.filter((filter) => {
|
||||||
if (searchFilter.length === 0) {
|
if (searchFilter.length === 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return filter.includes(searchFilter);
|
return filter
|
||||||
|
.toLocaleLowerCase()
|
||||||
|
.includes(searchFilter.toLocaleLowerCase());
|
||||||
})
|
})
|
||||||
|
.filter((_, index) => index < numberOfFilters)
|
||||||
.map((e) => (
|
.map((e) => (
|
||||||
<CheckBoxComponent
|
<CheckBoxComponent
|
||||||
key={e}
|
key={e}
|
||||||
@ -80,7 +86,7 @@ function CommonCheckBox(props: CommonCheckBoxProps): JSX.Element {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
|
|
||||||
{numberOfFilters && statusObj.length > numberOfFilters && (
|
{isMoreButtonAvilable && (
|
||||||
<Button onClick={onClickMoreHandler} type="link">
|
<Button onClick={onClickMoreHandler} type="link">
|
||||||
More
|
More
|
||||||
</Button>
|
</Button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user