Display a message if relays list is empty
This commit is contained in:
		@@ -9,15 +9,16 @@ import {
 | 
			
		||||
  TableHead,
 | 
			
		||||
  TableRow,
 | 
			
		||||
  Tooltip,
 | 
			
		||||
  Typography,
 | 
			
		||||
} from "@mui/material";
 | 
			
		||||
import React from "react";
 | 
			
		||||
import { useNavigate } from "react-router-dom";
 | 
			
		||||
import { Device, DeviceApi, DeviceRelay, DeviceURL } from "../api/DeviceApi";
 | 
			
		||||
import { RelayApi, RelaysStatus } from "../api/RelayApi";
 | 
			
		||||
import { AsyncWidget } from "../widgets/AsyncWidget";
 | 
			
		||||
import { BoolText } from "../widgets/BoolText";
 | 
			
		||||
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
 | 
			
		||||
import { TimeWidget } from "../widgets/TimeWidget";
 | 
			
		||||
import { useNavigate } from "react-router-dom";
 | 
			
		||||
 | 
			
		||||
export function RelaysListRoute(p: {
 | 
			
		||||
  homeWidget?: boolean;
 | 
			
		||||
@@ -86,6 +87,10 @@ function RelaysList(p: {
 | 
			
		||||
    navigate(DeviceURL(dev!));
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  if (p.list.length === 0) {
 | 
			
		||||
    return <Typography>There is no configured relay yet!</Typography>;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <TableContainer component={Paper}>
 | 
			
		||||
      <Table sx={{ minWidth: 650 }}>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user