Skip to content

Commit 47ac20d

Browse files
committed
chore: null check removed
1 parent 22becf9 commit 47ac20d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/Common/SegmentedBarChart/SegmentedBarChart.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,19 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
4545

4646
const renderContent = () => {
4747
if (isProportional) {
48-
return entities?.map((entity) => {
49-
if (entity.value === 0) {
50-
return null
51-
}
52-
return (
48+
return entities
49+
.filter((entity) => !!entity.value)
50+
.map((entity) => (
5351
<div className="flexbox-col">
5452
{renderValue(entity.value, entity.label)}
5553
<div className="flex left dc__gap-6">
5654
<span style={{ backgroundColor: entity.color }} className="h-12 dc__border-radius-2 w-4" />
5755
{renderLabel(entity.label)}
5856
</div>
5957
</div>
60-
)
61-
})
58+
))
6259
}
63-
return entities?.map((entity) => (
60+
return entities.map((entity) => (
6461
<div className={`${isProportional ? 'flexbox-col' : 'flexbox dc__gap-4 dc__align-items-center'}`}>
6562
<div className="dot" style={{ backgroundColor: entity.color, width: '10px', height: '10px' }} />
6663
{renderValue(entity.value, entity.label)}

0 commit comments

Comments
 (0)