Files
blitzkit/src/components/TierWeights.tsx
T

34 lines
909 B
TypeScript
Raw Normal View History

2023-12-14 22:19:01 -06:00
import { Tier } from '../core/blitzkrieg/tankDefinitions';
2023-07-11 19:54:57 +00:00
import { theme } from '../stitches.config';
2023-06-19 18:08:34 +00:00
export type TierWeightsRecord = Partial<Record<Tier, number>>;
2024-03-12 23:36:56 -05:00
interface TierWeightsProps {
2023-06-19 18:08:34 +00:00
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={{
2023-07-10 17:44:56 +00:00
backgroundColor: theme.colors.appBackground1_light,
2023-06-19 18:08:34 +00:00
flex: weight,
2023-07-10 17:44:56 +00:00
color: theme.colors.textHighContrast_light,
2023-06-19 18:08:34 +00:00
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontSize: 16,
overflow: 'hidden',
borderRadius: 8,
minWidth: 16,
}}
>
{tier}
2023-06-19 18:08:34 +00:00
</div>
))}
</div>
);
}