vom laptop

This commit is contained in:
2022-12-05 19:04:39 +01:00
parent f3e85c3145
commit dfaa6f6c4c
22 changed files with 24354 additions and 21372 deletions

View File

@ -0,0 +1,42 @@
import React from "react";
import SortableTable from "./SortableTable";
import {THeader} from "./SortableTable";
import {IFlight} from '../interfaces/IFlights';
function Link2Flight(key: string, row: any, data: string | null)
{
var val: JSX.Element = <></>;
const link: string = 'https://de.dhv-xc.de/flight/' + row['IDFlight'];
val = <td><a href={link} target="_blank" rel="noopener noreferrer" >{data}</a></td>;
return val;
}
function Meter2Km(key: string, row: any, data: string | null)
{
var val: JSX.Element = <></>;
const numdata: number = +data! / 1000;
val = <td>{numdata}</td>;
return val;
}
export default function FlightsTable(flightdata: IFlight[])
//export default function FlightsTable(flightdata: any)
{
const headers: THeader[] = [
{ key: "IDFlight", label: "ID", visible: false },
{ key: "FlightDate", label: "Datum", callback: Link2Flight },
{ key: "TakeoffWaypointName", label: "Start" },
{ key: "Glider", label: "Gleitschirm" },
{ key: "BestTaskDistance", label: "Strecke", callback: Meter2Km },
{ key: "BestTaskType", label: "Streckentyp" },
{ key: "BestTaskPoints", label: "Punkte" }
];
return(
<div className='App'>
<SortableTable<IFlight> headers={headers} dataTbl={flightdata} ></SortableTable>
</div>
);
}