import React from "react"; import { AsyncWidget } from "../widgets/AsyncWidget"; import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer"; import { Device, DeviceApi } from "../api/DeviceApi"; import { TableContainer, Paper, Table, TableHead, TableRow, TableCell, TableBody, } from "@mui/material"; import { TimeWidget } from "../widgets/TimeWidget"; export function PendingDevicesRoute(): React.ReactElement { const loadKey = React.useRef(1); const [pending, setPending] = React.useState(); const load = async () => { setPending(await DeviceApi.PendingList()); }; const reload = () => { loadKey.current += 1; setPending(undefined); }; return ( ( )} /> ); } function PendingDevicesList(p: { pending: Device[]; onReload: () => void; }): React.ReactElement { return ( # Model Version Maximum number of relays Created {p.pending.map((dev) => ( {dev.id} {dev.info.reference} {dev.info.version} {dev.info.max_relays} ))}
); }