gtfs-display/src/components/trips-route-day-table-entri...

29 lines
700 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
export default function TableEntries({ array }) {
if (array !== undefined && array !== null && array.length > 0) {
// iterate over array
return array.map((item, index) => (
<tr
key={item.trip_id}
>
<td>{item.agency_name}</td>
<td>{item.agency_id}</td>
<td>{item.route_id}</td>
<td>{item.route_short_name}</td>
<td>{item.service_id}</td>
<td>{item.trip_id}</td>
<td>{item.trip_short_name}</td>
<td>{item.trip_headsign}</td>
</tr>
));
}
// data is empty
return null;
}
TableEntries.propTypes = {
array: PropTypes.array
};