Skip to content

Commit 53b1dc4

Browse files
committed
Fix small issues with PingTable
1 parent edf8615 commit 53b1dc4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Plan/react/dashboard/src/components/cards/common/PingTableCard.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ import {Card} from "react-bootstrap";
33
import CardHeader from "../CardHeader";
44
import {faWifi} from "@fortawesome/free-solid-svg-icons";
55
import PingTable from "../../table/PingTable";
6+
import {ChartLoader} from "../../navigation/Loader";
67

78
const PingTableCard = ({data}) => {
89
return (
910
<Card id={'ping-per-country'}>
1011
<CardHeader icon={faWifi} color="green" label={'html.label.connectionInfo'}/>
11-
<PingTable countries={data?.table || []}/>
12+
{data && <PingTable countries={data?.table || []}/>}
13+
{!data && <ChartLoader/>}
1214
</Card>
1315
)
1416
};

Plan/react/dashboard/src/components/table/PingTable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const PingTable = ({countries}) => {
3030
</tr>
3131
</thead>
3232
<tbody>
33-
{countries.length ? countries.map((country, i) => <PingRow key={i} country={country}/>) : <tr>
33+
{countries.length ? countries.map(country => <PingRow key={country?.country} country={country}/>) : <tr>
3434
<td>{t('generic.noData')}</td>
3535
<td>-</td>
3636
<td>-</td>

0 commit comments

Comments
 (0)