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

View File

@ -30,7 +30,7 @@ const PingTable = ({countries}) => {
</tr> </tr>
</thead> </thead>
<tbody> <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>{t('generic.noData')}</td>
<td>-</td> <td>-</td>
<td>-</td> <td>-</td>