sokko-g/website/src/features/games/GameRoute.jsx
Shinuwa 13434f72f6
Some checks failed
Deploy Sokko G / deploy (push) Failing after 3s
Add Aniimo guides and link game cards to toolbox checklists
2026-09-23 20:05:19 +02:00

36 lines
1.3 KiB
JavaScript

// Rôle : route vers les pages de jeux disponibles et leurs sous-pages.
import { AniimoPage } from "./aniimo/AniimoPage.jsx";
import { GamesPage } from "./GamesPage.jsx";
import { Diablo4Page } from "./diablo4/Diablo4Page.jsx";
import { MhwildsPage } from "./mhwilds/MhwildsPage.jsx";
export function GameRoute(props) {
const { gameId, games } = props;
const game = games.find((item) => item.id === gameId);
const heroStyle = game?.images?.heroBg ? { "--game-hero-image": `url("${game.images.heroBg}")` } : undefined;
if (!game) return <GamesPage {...props} />;
if (game.id === "aniimo") return <AniimoPage {...props} game={game} />;
if (game.id === "diablo4") return <Diablo4Page {...props} game={game} />;
if (game.id === "mhwilds") return <MhwildsPage {...props} game={game} />;
return (
<>
<section className="game-hero" style={heroStyle}>
<div>
<p className="eyebrow">{game.eyebrow || "Guide de jeu"}</p>
<h1>{game.title}</h1>
<p>{game.summary}</p>
</div>
</section>
<section className="info-grid">
{game.sections.map((section) => (
<article className="info-panel" key={section.title}>
<h2>{section.title}</h2>
<ul>{section.items.map((item) => <li key={item}>{item}</li>)}</ul>
</article>
))}
</section>
</>
);
}