get ammo and gear tables working

This commit is contained in:
iamBadgers committed 2026-11-01 21:01:00 -08:00
1 parent 49dec31761
commit 9298ebcd3e
23 files changed
+928 -391

No files matched your search

+19 -15
View File
@@ -1,20 +1,21 @@
import { useState, useEffect } from 'react'
import { useState, useEffect } from "react";
const baseUrl = typeof window !== 'undefined'
? window.location.origin
: process.env.VITE_VERCEL_URL || 'http://localhost:5173'; // Fallback for your server env
const baseUrl =
typeof window !== "undefined"
? window.location.origin
: process.env.VITE_VERCEL_URL || "http://localhost:5173"; // Fallback for your server env
const st = await fetch(`${baseUrl}/characters/collateral/stats.json`)
.then(r => r.json());
const st = await fetch(`${baseUrl}/characters/collateral/stats.json`).then(
(r) => r.json(),
);
const sk = await
fetch(`${baseUrl}/characters/collateral/skills.json`)
.then(r => r.json());
const sk = await fetch(`${baseUrl}/characters/collateral/skills.json`).then(
(r) => r.json(),
);
export function Stats() {
const [stats, setStats] = useState(st);
const [skills, setSkills] = useState(sk)
const [skills, setSkills] = useState(sk);
return (
<main>
@@ -52,7 +53,9 @@ export function Stats() {
</tr>
<tr>
<td>LUCK</td>
<td>{stats.luck}/{stats.luck}</td>
<td>
{stats.luck}/{stats.luck}
</td>
</tr>
<tr>
<td>MOVE</td>
@@ -64,11 +67,13 @@ export function Stats() {
</tr>
<tr>
<td>EMP</td>
<td>{stats.emp}/{stats.emp}</td>
<td>
{stats.emp}/{stats.emp}
</td>
</tr>
</tbody>
</table>
</main >
</main>
);
}
@@ -131,5 +136,4 @@ const resources = [
</svg>
),
},
];