Skip to content

Commit 4765805

Browse files
committed
Refactor EventList component to replace NumberFlow with conditional rendering for item count
- Removed the NumberFlow component and implemented conditional rendering to display item count based on hover state. - Enhanced user interaction by providing a more intuitive display of event counts during hover.
1 parent ba258a8 commit 4765805

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

client/src/app/[site]/events/components/EventList.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { useExtracted } from "next-intl";
4-
import NumberFlow from "@number-flow/react";
54
import { BookOpen, ChevronDown, ChevronRight, Info } from "lucide-react";
65
import { memo, useState } from "react";
76
import { EventName } from "../../../../api/analytics/endpoints";
@@ -178,7 +177,10 @@ export function EventList({ events, isLoading, size = "small" }: EventListProps)
178177
<div className="hidden group-hover:block text-neutral-500 dark:text-neutral-400">
179178
{Math.round(percentage * 10) / 10}%
180179
</div>
181-
<NumberFlow respectMotionPreference={false} value={event.count} format={{ notation: "compact" }} />
180+
<span className="group-hover:hidden">
181+
{event.count.toLocaleString(undefined, { notation: "compact" })}
182+
</span>
183+
<span className="hidden group-hover:inline">{event.count.toLocaleString()}</span>
182184
</div>
183185
</div>
184186
</div>

0 commit comments

Comments
 (0)