2024-09-08 21:52:12 -05:00
|
|
|
import { compositeStatsKeys, tankDefinitionsArray } from '@blitzkit/core';
|
2024-09-07 21:45:00 -05:00
|
|
|
import strings from '@blitzkit/core/lang/en-US.json';
|
2024-08-08 14:18:22 -05:00
|
|
|
import { use } from 'react';
|
|
|
|
|
import {
|
|
|
|
|
BreakdownEmbedCard,
|
|
|
|
|
BreakdownEmbedWrapper,
|
|
|
|
|
} from '../../../../components/TanksEmbed';
|
2024-09-14 18:32:36 -05:00
|
|
|
import { breakdownConfig } from '../../../../../../website/src/constants/embeds';
|
2024-08-08 14:18:22 -05:00
|
|
|
import { useEmbedStateCurry } from '../../../../stores/embedState/utilities';
|
|
|
|
|
|
2024-09-08 21:52:12 -05:00
|
|
|
export const compositeStatsKeysOptions = compositeStatsKeys.map((value) => ({
|
2024-08-10 13:29:10 -05:00
|
|
|
label: strings.common.composite_stats[value],
|
|
|
|
|
value,
|
|
|
|
|
}));
|
|
|
|
|
|
2024-08-08 14:18:22 -05:00
|
|
|
export function BreakdownPreview() {
|
|
|
|
|
const tanks = use(tankDefinitionsArray);
|
|
|
|
|
const { useState } = useEmbedStateCurry<typeof breakdownConfig>();
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<BreakdownEmbedWrapper>
|
|
|
|
|
{useState('showTotal') && <BreakdownEmbedCard tank={null} />}
|
|
|
|
|
|
|
|
|
|
{tanks.slice(0, useState('listMaxTanks')).map((tank) => (
|
|
|
|
|
<BreakdownEmbedCard key={tank.id} tank={tank} />
|
|
|
|
|
))}
|
|
|
|
|
</BreakdownEmbedWrapper>
|
|
|
|
|
);
|
|
|
|
|
}
|