mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
35 lines
966 B
TypeScript
35 lines
966 B
TypeScript
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia';
|
|
import { theme } from '../stitches.config';
|
|
|
|
export type TierWeightsRecord = Partial<Record<Tier, number>>;
|
|
|
|
export interface TierWeightsProps {
|
|
weights: TierWeightsRecord;
|
|
}
|
|
|
|
export default function TierWeights({ weights }: TierWeightsProps) {
|
|
return (
|
|
<div style={{ display: 'flex', gap: 8 }}>
|
|
{Object.entries(weights).map(([tier, weight]) => (
|
|
<div
|
|
key={tier}
|
|
style={{
|
|
backgroundColor: theme.colors.appBackground1_light,
|
|
flex: weight,
|
|
color: theme.colors.textHighContrast_light,
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
fontSize: 16,
|
|
overflow: 'hidden',
|
|
borderRadius: 8,
|
|
minWidth: 16,
|
|
}}
|
|
>
|
|
{TIER_ROMAN_NUMERALS[parseInt(tier) as Tier]}
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|