mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-12 12:16:11 +01:00
feat: player count
This commit is contained in:
1 parent
1d112bb633
commit
db83ac40b4
10 files changed
+49
-45
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { Table } from '@radix-ui/themes';
|
||||
import { memo, use } from 'react';
|
||||
import { memo, use, useMemo } from 'react';
|
||||
import { TankRowHeaderCell } from '../../../../components/TankRowHeaderCell';
|
||||
import { averageDefinitions } from '../../../../core/blitzkit/averageDefinitions';
|
||||
import { TankDefinition } from '../../../../core/blitzkit/tankDefinitions';
|
||||
@@ -11,7 +11,11 @@ interface TankRowProps {
|
||||
export const TankRow = memo<TankRowProps>(
|
||||
({ tank }) => {
|
||||
const awaitedAverageDefinitions = use(averageDefinitions);
|
||||
const averages = awaitedAverageDefinitions[tank.id];
|
||||
const averages = awaitedAverageDefinitions.averages[tank.id];
|
||||
const numberFormat = useMemo(
|
||||
() => Intl.NumberFormat(undefined, { notation: 'compact' }),
|
||||
[],
|
||||
);
|
||||
|
||||
return (
|
||||
<Table.Row>
|
||||
@@ -20,7 +24,7 @@ export const TankRow = memo<TankRowProps>(
|
||||
{Math.round(averages.mu.wins * 100)}%
|
||||
</Table.Cell>
|
||||
<Table.Cell align="center">
|
||||
{averages.samples.toLocaleString()}
|
||||
{numberFormat.format(Math.round(averages.samples))}
|
||||
</Table.Cell>
|
||||
<Table.Cell align="center">
|
||||
{Math.round(averages.mu.damage_dealt).toLocaleString()}
|
||||
@@ -47,9 +51,6 @@ export const TankRow = memo<TankRowProps>(
|
||||
<Table.Cell align="center">
|
||||
{averages.mu.capture_points.toFixed(2)}
|
||||
</Table.Cell>
|
||||
<Table.Cell align="center">
|
||||
{averages.mu.dropped_capture_points.toFixed(2)}
|
||||
</Table.Cell>
|
||||
</Table.Row>
|
||||
);
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user