import React from "react"; function Tables({persons}) { function addEventlistener(name){ return function(event){ var personDiv = document.getElementById(name); var extend = personDiv.lastChild; if (extend.style.display === "block") { extend.style.display = "none"; } else { extend.style.display = "block"; } } } var currentDate = new Date() const sortedpersons = persons.sort(function(a, b){return b.longitude - a.longitude}); return (

RACE

{currentDate.getDate()}.{currentDate.getMonth() + 1}.{currentDate.getFullYear()}

{sortedpersons.filter(person => person.online).map((person, index) => { return (
{person.longitude}-{person.latitude}-
{index + 1}
 
{person.shortName}
{person.speed}
{person.fullName}/

{person.fullName}

Geschwindigkeit: {person.speed}

Status: {person.online ? "online" : "offline"}

); })}
{sortedpersons.filter(person => !person.online).map(person => { return (
 
{person.shortName}
OUT
{person.fullName}/

{person.fullName}

Status: {person.online ? "online" : "offline"}

); })}
); } export default Tables;