import React from "react"; import PropTypes from "prop-types"; import { TableCell, TableRow, IconButton, Collapse } from "@material-ui/core"; import { KeyboardArrowDown, KeyboardArrowUp } from "@material-ui/icons"; import { makeStyles } from "@material-ui/core/styles"; import MachineLog from "./common/MachineLog"; import { useSensitiveInfo } from "../../../hooks"; import ActionsGroup from "./common/ActionsGroup"; const useRowStyles = makeStyles({ root: { "& > *": { borderBottom: "unset" } } }); const MachineTableRow = ({ machine, actions, logs, addLog, secondaryActionsMenuProps }) => { const [open, setOpen] = React.useState(false); const classes = useRowStyles(); const { mask } = useSensitiveInfo(); return ( setOpen(!open)} > {open ? : } {mask(machine.fullMachineName)} {mask(machine.machineName)} {mask(machine.iPv4Address)} {mask(machine.macAddress)} ); }; MachineTableRow.propTypes = { machine: PropTypes.shape({ machineId: PropTypes.number.isRequired, machineName: PropTypes.string.isRequired, fullMachineName: PropTypes.string.isRequired, macAddress: PropTypes.string.isRequired, iPv4Address: PropTypes.string, description: PropTypes.string }).isRequired, actions: PropTypes.array.isRequired, logs: PropTypes.array.isRequired, addLog: PropTypes.func.isRequired, secondaryActionsMenuProps: PropTypes.object.isRequired }; export default MachineTableRow;