feat: start work of text

This commit is contained in:
TrèsAbhi committed 2024-04-21 11:05:42 -05:00
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>
);
}
+2
View File
@@ -16,6 +16,7 @@ import { Modules } from './components/Characteristics/components/Modules';
import { Provisions } from './components/Characteristics/components/Provisions';
import { Skills } from './components/Characteristics/components/Skills';
import { TankSandbox } from './components/Model/TankSandbox';
import { TextualReference } from './components/TextualReference';
import { Title } from './components/Title';
import { Videos } from './components/Videos';
@@ -112,6 +113,7 @@ export default function Page({ params }: { params: { id: string } }) {
</Flex>
<Videos />
<TextualReference />
</>
)}
</PageWrapper>