Add a button to refresh table

This commit is contained in:
Pierre HUBERT 2024-07-03 22:07:41 +02:00
parent 8674d25512
commit 9cba9c5f0a

View File

@ -1,4 +1,6 @@
import CheckIcon from "@mui/icons-material/Check";
import DeleteIcon from "@mui/icons-material/Delete";
import RefreshIcon from "@mui/icons-material/Refresh";
import {
IconButton,
Paper,
@ -19,7 +21,6 @@ import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { TimeWidget } from "../widgets/TimeWidget";
import CheckIcon from "@mui/icons-material/Check";
export function PendingDevicesRoute(): React.ReactElement {
const loadKey = React.useRef(1);
@ -36,7 +37,16 @@ export function PendingDevicesRoute(): React.ReactElement {
};
return (
<SolarEnergyRouteContainer label="Pending devices">
<SolarEnergyRouteContainer
label="Pending devices"
actions={
<Tooltip title="Refresh table">
<IconButton onClick={reload}>
<RefreshIcon />
</IconButton>
</Tooltip>
}
>
<AsyncWidget
loadKey={loadKey.current}
ready={!!pending}