Fix small issues with PingTable

This commit is contained in:
Aurora Lahtela 2023-10-21 11:13:37 +03:00
parent edf86155d1
commit 53b1dc4e35
2 changed files with 4 additions and 2 deletions

View File

@ -3,12 +3,14 @@ import {Card} from "react-bootstrap";
import CardHeader from "../CardHeader";
import {faWifi} from "@fortawesome/free-solid-svg-icons";
import PingTable from "../../table/PingTable";
import {ChartLoader} from "../../navigation/Loader";
const PingTableCard = ({data}) => {
return (
<Card id={'ping-per-country'}>
<CardHeader icon={faWifi} color="green" label={'html.label.connectionInfo'}/>
<PingTable countries={data?.table || []}/>
{data && <PingTable countries={data?.table || []}/>}
{!data && <ChartLoader/>}
</Card>
)
};

View File

@ -30,7 +30,7 @@ const PingTable = ({countries}) => {
</tr>
</thead>
<tbody>
{countries.length ? countries.map((country, i) => <PingRow key={i} country={country}/>) : <tr>
{countries.length ? countries.map(country => <PingRow key={country?.country} country={country}/>) : <tr>
<td>{t('generic.noData')}</td>
<td>-</td>
<td>-</td>