migrate compare and tankopedia loadout to new data-driven components, splitting the old monolithic loadout and compare UI into smaller pieces and adding shared Table, Dialog and Scroller primitives

This commit is contained in:
tresabhi committed 2026-11-14 01:17:38 -06:00
1 parent 287aba853f
commit c311a6ab8b
111 files changed
+4009 -3917

No files matched your search

@@ -0,0 +1,5 @@
.value {
display: flex;
align-items: end;
gap: var(--space-1);
}
@@ -0,0 +1,32 @@
import { useCharacteristicRenderer } from "../../hooks/useCharacteristicRenderer";
import type {
CharacteristicRenderConfig,
CharacteristicReturnType,
} from "../../types/characteristics";
import { Text } from "../Text";
import styles from "./index.module.css";
interface CharacteristicValueProps {
config: CharacteristicRenderConfig;
value: CharacteristicReturnType;
units?: boolean;
}
export function CharacteristicValue({
config,
value,
units = true,
}: CharacteristicValueProps) {
const renderCharacteristic = useCharacteristicRenderer(units);
const hasUnits = units && config.units !== undefined;
return (
<Text
className={styles.value}
lowContrast={hasUnits}
size={hasUnits ? "minor" : undefined}
>
{renderCharacteristic(value, config)}
</Text>
);
}