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