bitburner-src/src/Bladeburner/ui/GeneralActionList.tsx

28 lines
909 B
TypeScript
Raw Normal View History

2021-06-18 22:22:12 +02:00
import React, { useState, useEffect } from "react";
import {
formatNumber,
convertTimeMsToTimeElapsedString,
} from "../../../utils/StringHelperFunctions";
import { GeneralActionElem } from "./GeneralActionElem";
import { Action } from "../Action";
import { GeneralActions } from "../GeneralActions";
import { IBladeburner } from "../IBladeburner";
2021-06-18 22:22:12 +02:00
interface IProps {
bladeburner: IBladeburner;
2021-06-18 22:22:12 +02:00
}
export function GeneralActionList(props: IProps): React.ReactElement {
const actions: Action[] = [];
for (const name in GeneralActions) {
if (GeneralActions.hasOwnProperty(name)) {
actions.push(GeneralActions[name]);
}
}
return (<>
2021-08-16 03:49:08 +02:00
{actions.map((action: Action) => <li key={action.name} className="bladeburner-action">
2021-06-18 22:22:12 +02:00
<GeneralActionElem bladeburner={props.bladeburner} action={action} />
2021-08-16 03:49:08 +02:00
</li>,
2021-06-18 22:22:12 +02:00
)}
</>);
}