mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: start work of text
This commit is contained in:
1 parent
0b222be6ef
commit
a2cfbda932
2 files changed
+34
No files matched your search
@@ -0,0 +1,32 @@
|
|||||||
|
import { Flex, Heading, Text } from '@radix-ui/themes';
|
||||||
|
import { sumBy } from 'lodash';
|
||||||
|
import { use, useMemo } from 'react';
|
||||||
|
import { tankDefinitions } from '../../../../../core/blitzkrieg/tankDefinitions';
|
||||||
|
import { useDuel } from '../../../../../stores/duel';
|
||||||
|
|
||||||
|
export function TextualReference() {
|
||||||
|
const awaitedTankDefinitions = use(tankDefinitions);
|
||||||
|
const tank = useDuel((state) => state.protagonist!.tank);
|
||||||
|
const tierTanks = useMemo(
|
||||||
|
() =>
|
||||||
|
Object.values(awaitedTankDefinitions).filter(
|
||||||
|
({ tier }) => tank.tier === tier,
|
||||||
|
),
|
||||||
|
[tank.id],
|
||||||
|
);
|
||||||
|
const averageDamage =
|
||||||
|
sumBy(
|
||||||
|
tierTanks,
|
||||||
|
(tank) => tank.turrets.at(-1)!.guns.at(-1)!.shells[0].damage.armor,
|
||||||
|
) / tierTanks.length;
|
||||||
|
|
||||||
|
console.log(averageDamage);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Flex direction="column" gap="2" mt="4">
|
||||||
|
<Heading size="6">Textual reference</Heading>
|
||||||
|
|
||||||
|
<Text></Text>
|
||||||
|
</Flex>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import { Modules } from './components/Characteristics/components/Modules';
|
|||||||
import { Provisions } from './components/Characteristics/components/Provisions';
|
import { Provisions } from './components/Characteristics/components/Provisions';
|
||||||
import { Skills } from './components/Characteristics/components/Skills';
|
import { Skills } from './components/Characteristics/components/Skills';
|
||||||
import { TankSandbox } from './components/Model/TankSandbox';
|
import { TankSandbox } from './components/Model/TankSandbox';
|
||||||
|
import { TextualReference } from './components/TextualReference';
|
||||||
import { Title } from './components/Title';
|
import { Title } from './components/Title';
|
||||||
import { Videos } from './components/Videos';
|
import { Videos } from './components/Videos';
|
||||||
|
|
||||||
@@ -112,6 +113,7 @@ export default function Page({ params }: { params: { id: string } }) {
|
|||||||
</Flex>
|
</Flex>
|
||||||
|
|
||||||
<Videos />
|
<Videos />
|
||||||
|
<TextualReference />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</PageWrapper>
|
</PageWrapper>
|
||||||
|
|||||||
Reference in new issue
Block a user