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

26 lines
703 B
TypeScript
Raw Normal View History

2021-08-19 07:45:26 +02:00
import React from "react";
2021-06-18 22:22:12 +02:00
import { GeneralActionElem } from "./GeneralActionElem";
import { Action } from "../Action";
import { GeneralActions } from "../GeneralActions";
import { Bladeburner } from "../Bladeburner";
2021-06-18 22:22:12 +02:00
interface IProps {
bladeburner: Bladeburner;
2021-06-18 22:22:12 +02:00
}
export function GeneralActionList(props: IProps): React.ReactElement {
2021-09-05 01:09:30 +02:00
const actions: Action[] = [];
2022-01-16 01:45:03 +01:00
for (const name of Object.keys(GeneralActions)) {
if (Object.hasOwn(GeneralActions, name)) {
2021-09-05 01:09:30 +02:00
actions.push(GeneralActions[name]);
2021-06-18 22:22:12 +02:00
}
2021-09-05 01:09:30 +02:00
}
return (
<>
{actions.map((action: Action) => (
2022-09-06 15:07:12 +02:00
<GeneralActionElem key={action.name} bladeburner={props.bladeburner} action={action} />
2021-09-05 01:09:30 +02:00
))}
</>
);
}