90 lines
2.6 KiB
TypeScript
90 lines
2.6 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 Social() {
|
|
|
|
const [stats, setStats] = useState(st)
|
|
const [skills, setSkills] = useState(sk)
|
|
|
|
return (
|
|
<main>
|
|
<table className="cyber-table">
|
|
<thead>
|
|
<tr>
|
|
<th style={{ width: "70%" }}>SOCIAL 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>BRIBERY</td>
|
|
<td>{skills.bribery}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.bribery}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>CONVERSATION</td>
|
|
<td>{skills.conversation}</td>
|
|
<td>{stats.emp}</td>
|
|
<td>{stats.emp + skills.conversation}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>HUMAN PERCEPTION</td>
|
|
<td>{skills.humper}</td>
|
|
<td>{stats.emp}</td>
|
|
<td>{stats.emp + skills.humper}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>INTERROGATION</td>
|
|
<td>{skills.interogation}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.interogation}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>PERSUASION</td>
|
|
<td>{skills.persuasion}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.persuasion}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>PERSONAL GROOMING</td>
|
|
<td>{skills.heavyweapons}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.heavyweapons}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>STREETWISE</td>
|
|
<td>{skills.streetwise}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.streetwise}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>TRADING</td>
|
|
<td>{skills.trading}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.trading}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>WARDROBE AND STYLE</td>
|
|
<td>{skills.wardrobe}</td>
|
|
<td>{stats.cool}</td>
|
|
<td>{stats.cool + skills.wardrobe}</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</main>
|
|
)
|
|
}
|