import React from 'react'; import { Link } from "react-router-dom"; import { Game } from '../types/Game'; import "../css/Games.css" interface GameEntryProps { game: Game; } const GameEntry: React.FC = ({ game }) => { React.useEffect(() => { game.category_portals.forEach(catInfo => { const itemBody = document.createElement("div"); const itemTitle = document.createElement("span"); const spacing = document.createElement("br"); const itemNum = document.createElement("span"); itemTitle.innerText = catInfo.category.name; itemNum.innerText = catInfo.portal_count as any as string; itemTitle.classList.add("games-page-item-body-item-title"); itemNum.classList.add("games-page-item-body-item-num"); itemBody.appendChild(itemTitle); itemBody.appendChild(spacing); itemBody.appendChild(itemNum); itemBody.className = "games-page-item-body-item"; // itemBody.innerHTML = ` // ${catInfo.category.name}
// ${catInfo.portal_count}` document.getElementById(`${game.id}`)!.appendChild(itemBody); }); }, []); return (
{game.name}
); }; export default GameEntry;