mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
exclude 0 item groups
This commit is contained in:
1 parent
632989087c
commit
231e4aad0e
4 files changed
+30
-9
No files matched your search
@@ -21,9 +21,16 @@ export function TankopediaCharacteristics({
|
||||
return (
|
||||
<div className={styles["characteristics-wrapper"]}>
|
||||
<div className={styles.characteristics}>
|
||||
{characteristicsOrder.map((group) => (
|
||||
<Group group={group} characteristics={characteristics} />
|
||||
))}
|
||||
{characteristicsOrder.map((group) => {
|
||||
const items = group.order.filter(
|
||||
(item) => "name" in item && characteristics[item.name] !== null,
|
||||
).length;
|
||||
const shouldRender = items > 0;
|
||||
|
||||
if (!shouldRender) return null;
|
||||
|
||||
return <Group group={group} characteristics={characteristics} />;
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user