Refactor MachineTableRow component

master^2
Tudor Stanciu 2024-03-25 02:58:52 +02:00
parent 1a53110db1
commit c46ffc2e39
1 changed files with 7 additions and 11 deletions

View File

@ -2,27 +2,23 @@ import React from "react";
import PropTypes from "prop-types";
import { TableCell, TableRow, IconButton, Collapse } from "@mui/material";
import { KeyboardArrowDown, KeyboardArrowUp } from "@mui/icons-material";
import { makeStyles } from "@mui/material/styles";
import MachineCollapsedContent from "./common/MachineCollapsedContent";
import { useSensitiveInfo } from "../../../hooks";
import ActionsGroup from "./common/ActionsGroup";
const useRowStyles = makeStyles({
root: {
"& > *": {
borderBottom: "unset"
}
}
});
const MachineTableRow = ({ machine, actions, logs, addLog }) => {
const [open, setOpen] = React.useState(false);
const classes = useRowStyles();
const { mask } = useSensitiveInfo();
return (
<React.Fragment>
<TableRow className={classes.root}>
<TableRow
sx={{
"& > *": {
borderBottom: "unset"
}
}}
>
<TableCell>
<IconButton aria-label="expand row" size="small" onClick={() => setOpen(!open)}>
{open ? <KeyboardArrowUp /> : <KeyboardArrowDown />}