bitburner-src/src/Faction/ui/Option.tsx

31 lines
834 B
TypeScript
Raw Normal View History

2019-04-14 11:08:10 +02:00
/**
* React component for a selectable option on the Faction UI. These
* options including working for the faction, hacking missions, purchasing
* augmentations, etc.
*/
import * as React from "react";
import { StdButton } from "../../ui/React/StdButton";
2021-09-21 02:42:13 +02:00
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import Paper from "@mui/material/Paper";
import Box from "@mui/material/Box";
2019-04-14 11:08:10 +02:00
type IProps = {
2021-09-05 01:09:30 +02:00
buttonText: string;
infoText: string;
onClick: (e: React.MouseEvent<HTMLElement>) => void;
};
2019-04-14 11:08:10 +02:00
2021-09-21 02:42:13 +02:00
export function Option(props: IProps): React.ReactElement {
return (
<Box>
<Paper sx={{ my: 1, p: 1, width: "100%" }}>
<Button onClick={props.onClick}>{props.buttonText}</Button>
<Typography>{props.infoText}</Typography>
</Paper>
</Box>
);
2019-04-14 11:08:10 +02:00
}