// Rôle : affiche les hitzones d'un monstre sous forme de tableau compact. import { assetPath } from "../utils.js"; const PHYSICAL_COLUMNS = ["cut", "blunt", "ammo"]; const ELEMENTAL_COLUMNS = ["fire", "water", "thunder", "ice", "dragon"]; const COLUMNS = ["name", ...PHYSICAL_COLUMNS, ...ELEMENTAL_COLUMNS]; function hitzoneValue(row, column) { if (column === "name") return row.name; return row.physical?.[column] ?? row.elemental?.[column]; } export function DamageTable({ rows, t }) { if (!rows.length) return null; return (
{COLUMNS.map((column) => ( ))} {rows.map((row, rowIndex) => ( {COLUMNS.map((column) => column === "name" ? ( ) : ( ))} ))}
{column === "name" ? "" : {t(column,}
{t(row.name, { capitalize: true })}{`${hitzoneValue(row,
); }