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

26 lines
703 B
TypeScript

import React from "react";
import { GeneralActionElem } from "./GeneralActionElem";
import { Action } from "../Action";
import { GeneralActions } from "../GeneralActions";
import { Bladeburner } from "../Bladeburner";
interface IProps {
bladeburner: Bladeburner;
}
export function GeneralActionList(props: IProps): React.ReactElement {
const actions: Action[] = [];
for (const name of Object.keys(GeneralActions)) {
if (Object.hasOwn(GeneralActions, name)) {
actions.push(GeneralActions[name]);
}
}
return (
<>
{actions.map((action: Action) => (
<GeneralActionElem key={action.name} bladeburner={props.bladeburner} action={action} />
))}
</>
);
}