49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import GroupAgencyPerDayTableEntries from './group-agency-per-day-table-entries';
|
|
|
|
// TODO For the cnnct feed, why do we get a 93 length agency array instead of 123?
|
|
|
|
/* destructure props object */
|
|
export default function GroupAgencyPerDayTable({ array, title, date }) {
|
|
if (array !== undefined && array !== null) {
|
|
/* return a React element */
|
|
return (
|
|
<>
|
|
<p>
|
|
Table of
|
|
{array.length}
|
|
{title}
|
|
{' '}
|
|
for
|
|
{date}
|
|
:
|
|
</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>agency_name |</th>
|
|
<th>abs. trip count |</th>
|
|
<th>RT TU count |</th>
|
|
<th>RT TU % |</th>
|
|
<th>latest RT timestamp |</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<GroupAgencyPerDayTableEntries array={array} />
|
|
</tbody>
|
|
</table>
|
|
</>
|
|
);
|
|
}
|
|
return (
|
|
<p>loading...</p>
|
|
);
|
|
}
|
|
GroupAgencyPerDayTable.propTypes = {
|
|
array: PropTypes.array,
|
|
title: PropTypes.string,
|
|
date: PropTypes.string,
|
|
};
|