/** * @file Une carte jouable dans la préparation d'une expédition ou l'inscription à une expédition ouverte : la * carte, sa Puissance en haut à droite, ses stats en icônes (nom au survol) et ses étiquettes : celles * utiles à la destination en pastilles (condition, dangers parés, Affinité), toutes au survol de * l'icône d'étiquette. * * Attention : en mode mobile, la tuile devient une ligne entièrement touchable (`MobileCardRow`) : sans survol, le * nom, la Puissance, les stats et les étiquettes y sont écrits en clair. */ import { useId } from "react"; import { Tooltip } from "../../../components/Tooltip.jsx"; import { fillTemplate } from "../textFormat.js"; import { useCardsMobile } from "../useCardsHref.js"; import { cardHelps, editionEntry, formatDecimal, STAT_BY_PLAN, STAT_IDS, tagLabel } from "./expeditionFormat.js"; import { MaskIcon } from "./ExpeditionLabels.jsx"; import { NebulaCard } from "../rendering/NebulaCard.jsx"; /** * Ligne d'une carte jouable sur téléphone : un seul bouton (petite carte, nom, Puissance, stats, étiquettes), nommé * « Choisir … » comme la tuile de l'ordinateur ; le détail est sa description accessible. */ function MobileCardRow({ catalog, entry, card, content, selected, sortKey, powerLabel, vocation, helps, tags, onSelect }) { const detailsId = useId(); return
  • ; } export function ExpeditionCardTile({ catalog, card, destination, content, selected, sortKey = null, onSelect }) { const mobile = useCardsMobile(); const entry = editionEntry(catalog, card.editionId); if (!entry) return null; const vocation = STAT_BY_PLAN[card.plan]; const helps = cardHelps(card, destination); const tags = (card.tags || []).map((tag) => tagLabel(catalog, tag)); const powerLabel = vocation ? fillTemplate(content.powerVocation, { power: card.power, stat: content.stats[vocation] }) : fillTemplate(content.power, { power: card.power }); if (mobile) return ; return
  • {vocation && } {card.busy && {content.busy}}
    {STAT_IDS.map((stat) => { const label = `${content.stats[stat]} : ${formatDecimal(card.stats[stat])}`; return ; })} {helps.condition && {content.tagCondition}} {helps.dangers.map((danger) => {fillTemplate(content.tagParry, { label: danger.label })})} {helps.affinity && {content.tagAffinity}}
  • ; }