mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 13:34:28 +08:00
fix: Add K display for new logs count values over 1000
This commit is contained in:
@@ -84,7 +84,7 @@ const PreviewFilterPanel: FC<Props> = ({
|
||||
>
|
||||
<div className="absolute z-20">
|
||||
<Typography.Text style={{ fontSize: '0.6rem' }} className="opacity-80">
|
||||
{newCount}
|
||||
{newCount > 1000 ? `${Math.floor(newCount / 100) / 10}K` : newCount}
|
||||
</Typography.Text>
|
||||
</div>
|
||||
<div className="bg-green-800 rounded-full w-full h-full animate-ping opacity-60"></div>
|
||||
|
||||
@@ -93,3 +93,11 @@ test.todo('timestamp to/from filter value change')
|
||||
// await screen.findByText('Custom')
|
||||
// await screen.findByTitle(/Clear timestamp filter/)
|
||||
// })
|
||||
|
||||
|
||||
|
||||
test('shortened count to K', async () => {
|
||||
render(<PreviewFilterPanel newCount={1234} />)
|
||||
await screen.findByText(/1\.2K/)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user