import { useNavigate, useParams } from "react-router-dom" import { Pico8Console } from "./pico8-client/Pico8Console"; import { useEffect, useState } from "react"; import { DbRelease } from "../server/dbal/dbal"; import { css } from "@emotion/css"; type Info = { release: DbRelease | null; versions: string[]; } export const GamePage = () => { const {author, slug, version} = useParams(); const navigate = useNavigate(); const [info, setInfo] = useState(null); useEffect(() => { const fetchInfo = async () => { let url = `/api/release?author=${author}&slug=${slug}`; if (version) { url += `&version=${version.slice(1)}`; } const information = await fetch(url); const json = await information.json(); setInfo(json); } fetchInfo(); }, [setInfo, author, slug, version]); if (!info) { return (
LOADING...
) } if (!info.release) { return (
NOT FOUND
) } return (

{info.release.manifest.title ?? slug!.split("-").map(word => word[0].toUpperCase()+word.slice(1)).join(" ")}

By {info.release.author}

Version:
Content below
Content below
Content below
Content below
Content below
Content below
Content below
Content below
Content below
Content below
Content below
Content below
Content below
) }