maybe fix build errors (again) #68

Merged
Quaternions merged 5 commits from mapspage-dev into staging 2025-04-03 08:01:00 +00:00
2 changed files with 20 additions and 16 deletions
web/src/app/maps

@ -1,17 +1,14 @@
"use client"
import Webpage from "@/app/_components/webpage"; import Webpage from "@/app/_components/webpage";
import { useParams } from "next/navigation";
interface MapParams { export default function Map() {
params: { const { mapId } = useParams<{mapId: string}>()
mapid: string;
};
}
export default function Map({ params }: MapParams) {
const { mapid } = params;
return ( return (
<Webpage> <Webpage>
<p>map { mapid }</p> <p>map { mapId }</p>
</Webpage> </Webpage>
); );
} }

@ -1,13 +1,20 @@
"use client"
import { useState, useEffect } from "react";
import Webpage from "@/app/_components/webpage"; import Webpage from "@/app/_components/webpage";
export default async function MapsPage() { export default function MapsPage() {
const ingameMaps = fetch("/api/maps?Page=1&Limit=10"); const [ingameMaps, setIngameMaps] = useState();
try { useEffect(() => {
fetch("/api/maps?Page=1&Limit=10")
.then(response => response.json())
.then(setIngameMaps);
}, []);
useEffect(() => {
console.log(ingameMaps); console.log(ingameMaps);
} catch(error) { }, [ingameMaps]);
console.log(error);
}
return ( return (
<Webpage> <Webpage>