Minor refacto

This commit is contained in:
2024-09-25 22:00:36 +02:00
parent e0f0067e89
commit 821b4644a2
4 changed files with 22 additions and 12 deletions

View File

@ -15,6 +15,7 @@ import React from "react";
import { Link, useNavigate } from "react-router-dom";
import { Device, DeviceApi, DevicesState, DeviceURL } from "../api/DeviceApi";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { BoolText } from "../widgets/BoolText";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { TimeWidget } from "../widgets/TimeWidget";
@ -109,11 +110,11 @@ function ValidatedDevicesList(p: {
<TimeWidget time={dev.time_update} />
</TableCell>
<TableCell align="center">
{p.states.get(dev.id)!.online ? (
<strong>Online</strong>
) : (
<em>Offline</em>
)}
<BoolText
val={p.states.get(dev.id)!.online}
positive="Online"
negative="Offline"
/>
<br />
<TimeWidget diff time={p.states.get(dev.id)!.last_ping} />
</TableCell>