diff --git a/src/components/Cars/CarSelectionTable/index.jsx b/src/components/Cars/CarSelectionTable/index.jsx index 2550b8e..b37d2ba 100644 --- a/src/components/Cars/CarSelectionTable/index.jsx +++ b/src/components/Cars/CarSelectionTable/index.jsx @@ -10,13 +10,13 @@ import { TablePagination, TableRow, } from "@material-ui/core"; -import CheckCircleIcon from "@material-ui/icons/CheckCircle"; import { useVehicleContext } from "../../Contexts/VehicleContext"; import { useStatusContext } from "../../Contexts/StatusContext"; import { LocalDateTimeString } from "../../../utils/dates"; import TableHeaderSortable from "../../Table/HeaderSortable"; import { logger } from "../../../services/monitoring"; +import ConnectedIcon from "../../Controls/ConnectedIcon"; const tableColumns = [ { @@ -138,14 +138,10 @@ const CarSelectionTable = (props) => { /> - {row.connected && ( - <> - -   - - )} + {row.vin} {row.model} diff --git a/src/components/Cars/List/index.jsx b/src/components/Cars/List/index.jsx index 0eaec4e..957ebf7 100644 --- a/src/components/Cars/List/index.jsx +++ b/src/components/Cars/List/index.jsx @@ -21,6 +21,7 @@ import { LocalDateTimeString } from "../../../utils/dates"; import TableHeaderSortable from "../../Table/HeaderSortable"; import SearchField from "../../Controls/SearchField"; import { logger } from "../../../services/monitoring"; +import ConnectedIcon from "../../Controls/ConnectedIcon"; const tableColumns = [ { @@ -132,6 +133,10 @@ const MainForm = () => { {vehicles.map((row) => ( + {row.vin} {row.model} diff --git a/src/components/Controls/ConnectedIcon/index.jsx b/src/components/Controls/ConnectedIcon/index.jsx new file mode 100644 index 0000000..475892d --- /dev/null +++ b/src/components/Controls/ConnectedIcon/index.jsx @@ -0,0 +1,21 @@ +import React from "react"; +import PropTypes from "prop-types"; +import CheckCircleIcon from "@material-ui/icons/CheckCircle"; + +const ConnectedIcon = (props) => { + if (props.connected) { + return ( + + + + ); + } + + return null; +}; + +ConnectedIcon.propTypes = { + connected: PropTypes.bool.isRequired, +}; + +export default ConnectedIcon;