Skip to content

Commit 9ea89bf

Browse files
committed
Add missing data information on info widget
1 parent 2a03202 commit 9ea89bf

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

src/components/Aggregates/AggregateDataWidget.tsx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,31 +89,31 @@ const AggregateDataWidget: React.FC<Props> = ({ options, metricsMap }) => {
8989
<div>
9090
{isLoading ? (
9191
<>Loading...</>
92+
) : data.length > 0 ? (
93+
<ul style={{ margin: "0", listStyle: "none", padding: "0" }}>
94+
{data.map((item, index) => {
95+
const value =
96+
typeof item.value === "string"
97+
? Math.floor(parseInt(item.value))
98+
: Math.floor(item.value);
99+
100+
const itemLabel = item.label;
101+
102+
const label = metricsMap?.[itemLabel] ?? itemLabel;
103+
104+
return (
105+
<li
106+
key={index}
107+
style={{ display: "flex", justifyContent: "space-between" }}
108+
>
109+
<div style={{ fontWeight: "700" }}>{label}</div>
110+
<div>{value}</div>
111+
</li>
112+
);
113+
})}
114+
</ul>
92115
) : (
93-
data.length > 0 && (
94-
<ul style={{ margin: "0", listStyle: "none", padding: "0" }}>
95-
{data.map((item, index) => {
96-
const value =
97-
typeof item.value === "string"
98-
? Math.floor(parseInt(item.value))
99-
: Math.floor(item.value);
100-
101-
const itemLabel = item.label;
102-
103-
const label = metricsMap?.[itemLabel] ?? itemLabel;
104-
105-
return (
106-
<li
107-
key={index}
108-
style={{ display: "flex", justifyContent: "space-between" }}
109-
>
110-
<div style={{ fontWeight: "700" }}>{label}</div>
111-
<div>{value}</div>
112-
</li>
113-
);
114-
})}
115-
</ul>
116-
)
116+
<div>No data found.</div>
117117
)}
118118
</div>
119119
</section>

0 commit comments

Comments
 (0)