mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: tier weights
This commit is contained in:
1 parent
d9690460d5
commit
35f0f614af
4 files changed
+85
-23
No files matched your search
@@ -0,0 +1,34 @@
|
||||
import { TIER_ROMAN_NUMERALS, Tier } from '../core/blitz/tankopedia.js';
|
||||
import { themeLight } from '../stitches.config.js';
|
||||
|
||||
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: themeLight.colors.appBackground1,
|
||||
flex: weight,
|
||||
color: themeLight.colors.textHighContrast,
|
||||
display: 'flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
fontSize: 16,
|
||||
overflow: 'hidden',
|
||||
borderRadius: 8,
|
||||
minWidth: 16,
|
||||
}}
|
||||
>
|
||||
{TIER_ROMAN_NUMERALS[parseInt(tier) as Tier]}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user