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