// Rôle : présente un groupe en formation sur le tableau de la Guilde : membres, rôles libres, résultat attendu, et l'inscription d'une carte. import { useState } from "react"; import { fillTemplate, formatCountdown } from "./dailyShare.js"; import { conditionText, coverEntry, dangerText, editionEntry, formatEclats, synergyLabels } from "./expeditionFormat.js"; import { NebulaCard } from "./NebulaCard.jsx"; const TIER_VARIANTS = { struggle: "neutral", success: "success", triumph: "gold" }; // Inscription : un rôle libre et une carte jouable non occupée. function JoinForm({ catalog, group, cards, content, busy, onJoin, onCancel }) { const [role, setRole] = useState(group.freeRoles[0]); const [editionId, setEditionId] = useState(null); const available = [...cards].filter((card) => !card.busy).sort((a, b) => (b.stats[role] ?? 0) - (a.stats[role] ?? 0) || b.power - a.power); return
{group.freeRoles.map((value) => )}
{available.length ? :

{fillTemplate(content.noCards, { count: 1 })}

}
; } export function ExpeditionGroupCard({ catalog, group, cards, content, now, busy, limitReached, minPlayers, onJoin, onLeave, onDepart }) { const [joining, setJoining] = useState(false); const cover = group.destination.coverCardId && coverEntry(catalog, group.destination.coverCardId); const projected = group.projected; return
{cover && }

{fillTemplate(content.groupMeta, { stars: "★".repeat(group.stars), hours: group.hours, creator: group.isCreator ? content.you : group.creatorName })}

{group.destination.name}

{fillTemplate(content.groupDeadline, { time: formatCountdown(group.recruitUntil - now), min: minPlayers })}

{group.freeRoles.length > 0 &&

{content.groupKeeper}

}
{projected.hiddenRequirements ? {content.hiddenResult} : <> {content.tiers[projected.tier]} {fillTemplate(content.score, { score: formatEclats(projected.scorePct) })} } {(projected.powers || []).map((power) => {content.powers[power]})} {synergyLabels(projected, catalog, content).map((label) => {label})} {projected.cohesionPct > 0 && {fillTemplate(content.cohesion, { value: projected.cohesionPct })}} {fillTemplate(content.lootBonus, { value: formatEclats(projected.lootPct / 100) })}
{group.condition &&

{conditionText(group.condition, catalog, content)}

} {group.dangers.map((danger) =>

{dangerText(danger, catalog, content)}

)}
{group.canJoin && !joining && } {group.isCreator && } {group.isMember && }
{group.isCreator && !group.canDepart &&

{fillTemplate(content.departWait, { min: minPlayers })}

} {group.canJoin && limitReached &&

{content.groupLimit}

} {joining && { if (await onJoin(...args)) setJoining(false); }} onCancel={() => setJoining(false)} />}
; }