bitburner-src/src/PersonObjects/Sleeve/ui/StatsElement.tsx

32 lines
1.2 KiB
TypeScript
Raw Normal View History

import { Sleeve } from "../Sleeve";
import { numeralWrapper } from "../../../ui/numeralFormat";
2021-09-27 02:55:38 +02:00
import React from "react";
import { StatsTable } from "../../../ui/React/StatsTable";
interface IProps {
sleeve: Sleeve;
}
export function StatsElement(props: IProps): React.ReactElement {
2021-09-27 02:55:38 +02:00
const rows = [
[
"HP: ",
<>
{numeralWrapper.formatHp(props.sleeve.hp)} / {numeralWrapper.formatHp(props.sleeve.max_hp)}
</>,
],
["City: ", <>{props.sleeve.city}</>],
2021-11-05 22:12:52 +01:00
["Hacking: ", <>{numeralWrapper.formatSkill(props.sleeve.hacking)}</>],
2021-09-27 02:55:38 +02:00
["Strength: ", <>{numeralWrapper.formatSkill(props.sleeve.strength)}</>],
["Defense: ", <>{numeralWrapper.formatSkill(props.sleeve.defense)}</>],
["Dexterity: ", <>{numeralWrapper.formatSkill(props.sleeve.dexterity)}</>],
["Agility: ", <>{numeralWrapper.formatSkill(props.sleeve.agility)}</>],
["Charisma: ", <>{numeralWrapper.formatSkill(props.sleeve.charisma)}</>],
["Shock: ", <>{numeralWrapper.formatSleeveShock(100 - props.sleeve.shock)}</>],
["Sync: ", <>{numeralWrapper.formatSleeveSynchro(props.sleeve.sync)}</>],
["Memory: ", <>{numeralWrapper.formatSleeveMemory(props.sleeve.memory)}</>],
];
return <StatsTable rows={rows} />;
}