"use client"; import { useState, useEffect, useCallback, useRef, useMemo } from "react"; import { PatchesPuzzle, Region } from "@/lib/generators/patches"; import WinBanner from "./WinBanner"; interface Props { puzzle: PatchesPuzzle; date: string; onSolve?: (elapsed: number) => void; } const MAX_CELL = 72; const STORAGE_KEY = (d: string) => `patches-${d}`; /** Tiny pixel-art preview of the polyomino shape. */ function ShapePreview({ relCells, previewRows, previewCols, color, cellPx, }: { relCells: [number, number][]; previewRows: number; previewCols: number; color: string; cellPx: number; }) { const filled = new Set(relCells.map(([r, c]) => `${r},${c}`)); const gap = 1; return (
Région active — peignez les {regionById.get(activeId)?.size} cases
)}Cliquez sur une icône pour activer sa région, puis peignez les cases. La forme en aperçu indique la disposition à reproduire.