Ir al contenido principal
import React from 'react'; import { Button } from './ui/button'; import { Input } from './ui/input'; import { Card, CardContent, CardHeader, CardTitle } from './ui/card'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './ui/select'; import { Trash2, RotateCcw } from 'lucide-react'; interface Cell { letter: string; isBlack: boolean; number?: number; } interface Clue { number: number; direction: 'horizontal' | 'vertical'; clue: string; answer: string; } interface CrosswordGeneratorProps { grid: Cell[][]; selectedCell: {row: number, col: number} | null; setSelectedCell: React.Dispatch>; isBlackMode: boolean; setIsBlackMode: React.Dispatch>; clues: Clue[]; currentClue: { number: number; direction: 'horizontal' | 'vertical'; clue: string; answer: string; }; setCurrentClue: React.Dispatch>; onCellClick: (row: number, col: number) => void; onCellKeyPress: (e: React.KeyboardEvent, row: number, col: number) => void; onNumberGrid: () => void; onClearGrid: () => void; onAddClue: () => void; onRemoveClue: (index: number) => void; onUpdateClueNumber: () => void; } const GRID_SIZE = 15; export function CrosswordGenerator({ grid, selectedCell, setSelectedCell, isBlackMode, setIsBlackMode, clues, currentClue, setCurrentClue, onCellClick, onCellKeyPress, onNumberGrid, onClearGrid, onAddClue, onRemoveClue, onUpdateClueNumber }: CrosswordGeneratorProps) { return (

Generador de Crucigramas

Crea tus propios crucigramas de forma interactiva

{/* Grid Area */}
{grid.map((row, rowIndex) => row.map((cell, colIndex) => (
onCellClick(rowIndex, colIndex)} tabIndex={cell.isBlack ? -1 : 0} onKeyDown={(e) => onCellKeyPress(e, rowIndex, colIndex)} > {cell.number && ( {cell.number} )} {!cell.isBlack && ( {cell.letter} )}
)) )}

{isBlackMode ? "Haz clic en las casillas para hacerlas negras/blancas" : "Haz clic en una casilla y escribe para agregar letras" }

{/* Controls Area */}
Agregar Pista
setCurrentClue(prev => ({ ...prev, number: parseInt(e.target.value) || 1 }))} className="w-20" min="1" />
setCurrentClue(prev => ({ ...prev, answer: e.target.value.toUpperCase() }))} onKeyDown={(e) => { if (e.key === 'Enter' && currentClue.answer.trim() && currentClue.clue.trim()) { onAddClue(); } }} /> setCurrentClue(prev => ({ ...prev, clue: e.target.value }))} onKeyDown={(e) => { if (e.key === 'Enter' && currentClue.answer.trim() && currentClue.clue.trim()) { onAddClue(); } }} /> {(!currentClue.answer.trim() || !currentClue.clue.trim()) && (

Completa tanto la respuesta como la pista para agregar

)}
{clues.length > 0 && ( Pistas ({clues.length})
{clues.map((clue, index) => (
{clue.number} {clue.direction === 'horizontal' ? 'H' : 'V'} {clue.answer}

{clue.clue}

))}
)}
); }

Comentarios

Entradas más populares de este blog

Guía Interactiva de Inglés Básico Guía Interactiva de Inglés Desde Cero ¡Bienvenido! Empieza a aprender inglés con estas lecciones básicas. 1. El Alfabeto Lecciones del Alfabeto Alfabeto y pronunciación A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 2. Vocabulario Básico Lecciones de Vocabulario Saludos y frases comunes Hello - Hola Goodbye - Adiós Please - Por favor Thank you - Gracias Números (1-10) One - Uno Two - Dos Three - Tres 3. Verbos Principales Lecciones de Verbos Verbo "To Be" El verbo 'to be...
Generador de Crucigramas 🧩 Generador de Crucigramas Tamaño del Crucigrama: × Crear Cuadrícula Agregar Palabra: Horizontal Vertical Agregar Palabra Limpiar Todo Quitar Última Palabras Agregadas: Vista Previa del Crucigrama ...
Generador de Crucigramas Generador de Crucigramas Crea crucigramas personalizados de forma fácil e intuitiva Configuración Filas Columnas Generar Cuadrícula Añadir Palabra Palabra Pista ...