All files / src/components GeoHeader.tsx

66.66% Statements 2/3
66.66% Branches 4/6
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                        1x 1x                        
// File: src/components/GeoHeader.tsx
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faTowerBroadcast } from '@fortawesome/free-solid-svg-icons';
import styles from '../GeoMapWidget.module.css';
 
export function GeoHeader(props: {
  show: boolean;
  stationId: string;
  antennaCount: number;
  loading: boolean;
  error?: unknown | null;
}) {
  Iif (!props.show) return null;
  return (
    <div className={styles.header}>
      <div className={styles.title}>
        <FontAwesomeIcon icon={faTowerBroadcast} />
        <code>{props.stationId}</code>
        <span>&nbsp;•&nbsp;Antennas: {props.antennaCount}</span>
      </div>
      {props.loading && <div className={styles.status}>Loading…</div>}
      {props.error && <div className={styles.error}>{String(props.error)}</div>}
    </div>
  );
}