Files
blitzkit/packages/website/src/components/Performance/PlayerCountControl.tsx
T

47 lines
1.6 KiB
TypeScript
Raw Normal View History

2024-07-12 13:53:11 -05:00
import { Flex, Select, Text } from '@radix-ui/themes';
2025-01-07 12:47:55 -06:00
import { useLocale } from '../../hooks/useLocale';
2025-09-01 18:16:41 -05:00
import { Performance, type PlayerCountPeriod } from '../../stores/performance';
2024-07-12 13:53:11 -05:00
export function PlayerCountControl() {
2025-09-01 18:16:41 -05:00
const playerCountPeriod = Performance.use((state) => state.playerCountPeriod);
2025-01-07 12:47:55 -06:00
const { strings } = useLocale();
2024-07-12 13:53:11 -05:00
return (
<Flex justify="center" align="center" gap="2">
2025-01-07 12:47:55 -06:00
<Text>{strings.website.tools.performance.player_count.label}</Text>
2024-07-12 13:53:11 -05:00
<Select.Root
value={playerCountPeriod}
onValueChange={(period) => {
2025-09-01 18:16:41 -05:00
Performance.mutate((draft) => {
2024-07-12 13:53:11 -05:00
draft.playerCountPeriod = period as PlayerCountPeriod;
});
}}
>
2025-04-21 17:01:32 -05:00
<Select.Trigger variant="classic" />
2024-07-12 13:53:11 -05:00
<Select.Content>
2025-01-07 12:47:55 -06:00
<Select.Item value="total">
{strings.common.player_count_period.total}
</Select.Item>
<Select.Item value="d_120">
{strings.common.player_count_period.d_120}
</Select.Item>
<Select.Item value="d_90">
{strings.common.player_count_period.d_90}
</Select.Item>
<Select.Item value="d_60">
{strings.common.player_count_period.d_60}
</Select.Item>
<Select.Item value="d_30">
{strings.common.player_count_period.d_30}
</Select.Item>
<Select.Item value="d_7">
{strings.common.player_count_period.d_7}
</Select.Item>
<Select.Item value="d_1">
{strings.common.player_count_period.d_1}
</Select.Item>
2024-07-12 13:53:11 -05:00
</Select.Content>
</Select.Root>
</Flex>
);
}