diff --git a/src/app/tools/tankopedia/[id]/components/Model/MetaSection.tsx b/src/app/tools/tankopedia/[id]/components/Model/MetaSection.tsx deleted file mode 100644 index 4f45720c6..000000000 --- a/src/app/tools/tankopedia/[id]/components/Model/MetaSection.tsx +++ /dev/null @@ -1,131 +0,0 @@ -import { Code, Flex, Heading, Text } from '@radix-ui/themes'; -import { classIcons } from '../../../../../../components/ClassIcon'; -import { asset } from '../../../../../../core/blitzkit/asset'; -import { tankIcon } from '../../../../../../core/blitzkit/tankIcon'; -import strings from '../../../../../../lang/en-US.json'; -import * as App from '../../../../../../stores/app'; -import * as Duel from '../../../../../../stores/duel'; - -export function MetaSection() { - const developerMode = App.useDeferred(false, (state) => state.developerMode); - const tank = Duel.use((state) => state.protagonist.tank); - const ClassIcon = classIcons[tank.class]; - - return ( - - - Economics - - - - Overview - - - - Name - {tank.nameFull && Full-name} - Nation - Tier - Class - Type - {developerMode && ( - - DEV: ID - - )} - - - - {tank.name} - {tank.nameFull && {tank.nameFull}} - - - {tank.nation} - { - strings.common.nations[ - tank.nation as keyof typeof strings.common.nations - ] - } - - - {tank.tier} - - - - {strings.common.tank_class_short[tank.class]} - - - - {strings.common.tree_type[tank.treeType]} - - {developerMode && {tank.id}} - - - - - - Economics - - - - - {tank.price.type === 'credits' ? 'Purchase' : 'Restoration'}{' '} - price - - Sale price - {tank.xp && Research XP} - - - - - {tank.price.value.toLocaleString()} - {tank.price.type} - - - - {(tank.price.value / 2).toLocaleString()} - {tank.price.type} - - - {tank.xp && ( - - {tank.xp.toLocaleString()} - xp - - )} - - - - - - - ); -} diff --git a/src/app/tools/tankopedia/[id]/components/Model/MetaSection/components/Listing.tsx b/src/app/tools/tankopedia/[id]/components/Model/MetaSection/components/Listing.tsx new file mode 100644 index 000000000..688dc1cd4 --- /dev/null +++ b/src/app/tools/tankopedia/[id]/components/Model/MetaSection/components/Listing.tsx @@ -0,0 +1,14 @@ +import { Flex, Text, TextProps } from '@radix-ui/themes'; + +type ListingProps = TextProps & { + label: string; +}; + +export function Listing({ label, ...props }: ListingProps) { + return ( + + {label} + + + ); +} diff --git a/src/app/tools/tankopedia/[id]/components/Model/MetaSection/index.tsx b/src/app/tools/tankopedia/[id]/components/Model/MetaSection/index.tsx new file mode 100644 index 000000000..25bc5d4a1 --- /dev/null +++ b/src/app/tools/tankopedia/[id]/components/Model/MetaSection/index.tsx @@ -0,0 +1,127 @@ +import { Code, Flex, Heading } from '@radix-ui/themes'; +import { classIcons } from '../../../../../../../components/ClassIcon'; +import { asset } from '../../../../../../../core/blitzkit/asset'; +import { tankIcon } from '../../../../../../../core/blitzkit/tankIcon'; +import strings from '../../../../../../../lang/en-US.json'; +import * as App from '../../../../../../../stores/app'; +import * as Duel from '../../../../../../../stores/duel'; +import { Listing } from './components/Listing'; + +export function MetaSection() { + const developerMode = App.useDeferred(false, (state) => state.developerMode); + const tank = Duel.use((state) => state.protagonist.tank); + const ClassIcon = classIcons[tank.class]; + + return ( + + + Economics + + + + + Overview + + + {tank.name} + {tank.nameFull && ( + {tank.nameFull} + )} + + + {tank.nation} + { + strings.common.nations[ + tank.nation as keyof typeof strings.common.nations + ] + } + + + {tank.tier} + + + + {strings.common.tank_class_short[tank.class]} + + + + {strings.common.tree_type[tank.treeType]} + + {developerMode && ( + + {tank.id} + + )} + + + + + Economics + + + + + {tank.price.value.toLocaleString()} + {tank.price.type} + + + + + {(tank.price.value / 2).toLocaleString()} + {tank.price.type} + + + {tank.xp && ( + + + {tank.xp.toLocaleString()} + xp + + + )} + + + + + ); +}