import React, { useEffect } from "react" import { FaUser, FaLock, FaGlobe, FaTags, FaCalendarAlt, FaQuestionCircle, FaComment, FaTimes, FaEdit } from "react-icons/fa" export default function DeckInfoPopUp({ deck, onClose }) { if (!deck) return null // Debug: Log the deck structure to see what we're working with console.log('Deck in popup:', deck) console.log('Cards:', deck.cards) // Scroll blokkolás amikor a popup nyitva van useEffect(() => { // Scroll letiltása document.body.style.overflow = 'hidden' // Cleanup function - scroll visszaállítása amikor a komponens unmount-ol return () => { document.body.style.overflow = 'unset' } }, []) const deckTypes = { "Luck": { label: "Szerencse", color: "var(--color-luck)" }, "Question": { label: "Kérdés", color: "var(--color-question)" }, "Fun": { label: "Szórakozás", color: "var(--color-fun)" } } const currentDeckType = deckTypes[deck.type] || { label: deck.type, color: "var(--color-success)" } // Use real deck data with safe fallbacks const creator = deck.creatorName || deck.creator || (deck.user && deck.user.name) || "Ismeretlen" const privacy = deck.origin === "Vállalati" || deck.ctype === 1 || deck.privacy === 'public' ? "Publikus" : "Privát" // Get data from raw if available const rawData = deck.raw || deck // Use played number from raw data for answers count const questionsCount = rawData.cardCount || 0 const answersCount = rawData.playedNumber || 0 console.log('Calculated counts:', { questionsCount, answersCount, rawData }) const mockData = { ...deck, creator, privacy, questionsCount, answersCount } const formatDate = (dateString) => { const date = new Date(dateString) return date.toLocaleDateString('hu-HU', { year: 'numeric', month: 'long', day: 'numeric' }) } const handleOpenDeck = () => { alert("⚠️ A pakli megnyitás funkció még fejlesztés alatt áll!") } const handleEditDeck = () => { alert("⚠️ A pakli szerkesztés funkció még fejlesztés alatt áll!") } return (