From 4bc3bc4e401661d470912670cd900d556789860d Mon Sep 17 00:00:00 2001 From: Ru Chern Chong Date: Sun, 28 Jul 2024 03:25:31 +0800 Subject: [PATCH] Remove 0 registrations --- components/Leaderboard.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/Leaderboard.tsx b/components/Leaderboard.tsx index 7ec1d10..74c1d67 100644 --- a/components/Leaderboard.tsx +++ b/components/Leaderboard.tsx @@ -59,6 +59,7 @@ const getPopularMakes = (cars: Car[], fuelType: string): PopularMake[] => { }); return Object.entries(makeCount) + .filter(([_, number]) => Boolean(number)) // Remove 0 registrations .map(([make, number]) => ({ make, number })) .sort((a, b) => b.number - a.number) .slice(0, 3);