maybe fix build errors (again) #68
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user