42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
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 Performance() {
|
|
|
|
const [stats, setStats] = useState(st)
|
|
const [skills, setSkills] = useState(sk)
|
|
|
|
return (
|
|
<main>
|
|
<table className="cyber-table">
|
|
<thead>
|
|
<tr>
|
|
<th style={{ width: "70%" }}>PERFORMANCE SKILLS</th>
|
|
<th style={{ width: "10%" }}>RANKS</th>
|
|
<th style={{ width: "10%" }}>STAT</th>
|
|
<th style={{ width: "10%" }}>BASE</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>ACTING</td>
|
|
<td>{skills.acting}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.acting}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</main>
|
|
)
|
|
}
|