// Rôle : affiche les listes de jeu transformables en checklist. import { CopyChecklistItemsButton } from "./CopyChecklistItemsButton.jsx"; import { GameBreadcrumb } from "./GameBreadcrumb.jsx"; function getChecklistSections(list) { return (list?.categories || []).map((category) => ({ title: category.title, items: category.items.map((item) => ({ label: item.name, quantity: item.quantity })) })); } function SymbolText({ text }) { return String(text || "").split(/([♂♀])/g).map((part, index) => ( part === "♂" || part === "♀" ? {part} : part )); } export function GameListsPage({ game, lists, selectedListId, onSelectList, linkedToolboxId, onCreateChecklist }) { const selectedList = lists.find((list) => list.id === selectedListId) || lists[0] || null; const selectedSections = getChecklistSections(selectedList); return ( <>

Listes

Sélectionnez une liste, puis copiez-la ou créez une checklist dans la toolbox associée.

Proposer une nouvelle liste
{lists.length ? ( <>
{lists.map((list) => (
))}

{selectedList.title}

{selectedList.categories.map((category) => (

{category.items.length}
    {category.items.map((item) => (
  • {item.hasQuantity && item.quantity !== 1 ? x{item.quantity} : null}
    {item.description ? {item.description} : null}
  • ))}
))}
) : (

Aucune liste

Aucune liste n’est encore disponible pour ce jeu.

)} ); }