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 { useParams } from "next/navigation";
interface MapParams {
params: {
mapid: string;
};
}
export default function Map({ params }: MapParams) {
const { mapid } = params;
export default function Map() {
const { mapId } = useParams<{mapId: string}>()
return (
<Webpage>
<p>map { mapid }</p>
<p>map { mapId }</p>
</Webpage>
);
}
}

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