feat: load tank data

This commit is contained in:
TrèsAbhi committed 2025-11-28 14:21:26 -06:00
1 parent 6a958da390
commit 383d3a36ef
3 files changed
+39 -1

No files matched your search

@@ -0,0 +1,23 @@
---
import type { GetStaticPaths } from "astro";
import { api } from "../../../core/api/dynamic";
export const getStaticPaths = (async () => {
const { tanks } = await api.tanks();
return tanks.map((tank) => ({
params: { slug: tank.slug },
props: { id: tank.id },
}));
}) satisfies GetStaticPaths;
const { id } = Astro.props;
---
<h1>Tank {id}</h1>
<div style="max-height: 40rem; overflow-y: scroll">
<code>
<pre>{JSON.stringify( await api.tank(id) , null, 2)}</pre>
</code>
</div>