import type { Stat } from "../types"; import { getModifier, formatModifier } from "../utils/modifiers"; import styles from "./StatBlock.module.css"; const STAT_ORDER = ["STR", "DEX", "CON", "INT", "WIS", "CHA"]; interface StatBlockProps { stats: Stat[]; onStatChange: (statName: string, newValue: number) => void; mode?: "view" | "edit"; } export default function StatBlock({ stats, onStatChange, mode = "view", }: StatBlockProps) { const statMap = new Map(stats.map((s) => [s.stat_name, s.value])); return (