A lot of work on styling. Packaging up the details component.
This commit is contained in:
1 parent
696ec515eb
commit
824ee6e1e8
10 files changed
+149
-656
No files matched your search
+21
-1
@@ -1,7 +1,27 @@
|
||||
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 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());
|
||||
|
||||
export function Health() {
|
||||
|
||||
const [stats, setStats] = useState(st);
|
||||
const [skills, setSkills] = useState(sk)
|
||||
|
||||
return (
|
||||
<main>
|
||||
<span>HEALTH</span>
|
||||
<div style={{display: "flex", flexDirection: "column"}}>
|
||||
<span>Health: {stats.hp} / {stats.maxhp}</span>
|
||||
<span>Seriously Wounded: {stats.seriouslywounded}</span>
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user