import React, { Component, Fragment } from "react"; import { WithTheme, withTheme } from "@material-ui/core/styles"; import { Table, TableBody, TableCell, TableHead, TableRow, Divider, List, ListItem, ListItemAvatar, ListItemText, } from "@material-ui/core"; import RefreshIcon from "@material-ui/icons/Refresh"; import DeviceHubIcon from "@material-ui/icons/DeviceHub"; import { RestFormProps, FormActions, FormButton, HighlightAvatar, } from "../components"; import { busStatus, busStatusHighlight, isConnected } from "./EMSESPStatus"; import { EMSESPStatus } from "./EMSESPtypes"; type EMSESPStatusFormProps = RestFormProps & WithTheme; class EMSESPStatusForm extends Component { createListItems() { const { data, theme } = this.props; return ( {isConnected(data) && ( Statistic # Telegrams (Rx) Received telegrams {data.rx_received} (Rx) Incomplete telegrams {data.crc_errors} (Tx) Successfully sent telegrams {data.tx_sent} (Tx) Send Errors {data.tx_errors}
)}
); } render() { return ( {this.createListItems()} } variant="contained" color="secondary" onClick={this.props.loadData} > Refresh ); } } export default withTheme(EMSESPStatusForm);