import React from "react"; import Dialog from '@material-ui/core/Dialog'; import MuiDialogTitle from '@material-ui/core/DialogTitle'; import IconButton from '@material-ui/core/IconButton'; import CloseIcon from '@material-ui/icons/Close'; import Typography from '@material-ui/core/Typography'; import useStyles from "../useStyles"; const VehiclePopUp = (props) => { const classes = useStyles(); const { vin, online, battery, doors, location, windows, onClose } = props; return ( {vin}

Connected: {online.toString()}

{online && (
{battery != null && (

battery: {battery.percent}%

)} {doors != null && (

Doors

{Object.entries(doors).map((value) => (

{value[0]}: {value[1] ? "open" : "closed"}

))}
)} {windows != null && (

Windows

{Object.entries(windows).map((value) => (

{value[0]}: {value[1] ? "open" : "closed"}

))}
)} {location != null && (

Location

{Object.entries(location).map((value) => (

{value[0]}: {value[1]}

))}
)}
)} {(!online || (battery == null && doors == null && location == null && windows == null)) && (

No vehicle data to display.

)}
); }; const DialogTitle = (props) => { const { children, onClose, ...other } = props; const classes = useStyles(); return ( {children} {onClose ? ( ) : null} ); }; export { VehiclePopUp };