bitburner-src/src/CotMG/ui/Cell.tsx

41 lines
835 B
TypeScript
Raw Normal View History

2021-09-25 23:21:50 +02:00
import * as React from "react";
2021-10-04 02:34:36 +02:00
import makeStyles from "@mui/styles/makeStyles";
import { TableCell as MuiTableCell, TableCellProps } from "@mui/material";
const useStyles = makeStyles({
root: {
border: "1px solid white",
width: "5px",
height: "5px",
},
});
export const TableCell: React.FC<TableCellProps> = (props: TableCellProps) => {
return (
<MuiTableCell
{...props}
classes={{
root: useStyles().root,
...props.classes,
}}
/>
);
};
2021-09-25 23:21:50 +02:00
type IProps = {
onMouseEnter?: () => void;
onClick?: () => void;
color: string;
};
2021-10-04 02:34:36 +02:00
export function Cell(cellProps: IProps): React.ReactElement {
2021-09-25 23:21:50 +02:00
return (
2021-10-04 02:34:36 +02:00
<TableCell
2021-09-25 23:21:50 +02:00
style={{ backgroundColor: cellProps.color }}
onMouseEnter={cellProps.onMouseEnter}
onClick={cellProps.onClick}
2021-10-04 02:34:36 +02:00
></TableCell>
2021-09-25 23:21:50 +02:00
);
}