25 lines
601 B
JavaScript
25 lines
601 B
JavaScript
import React, { useEffect, useState } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import TableHead from './agency-id-name-table-head';
|
|
|
|
/* the simplest way to define a component is to write a JavaScript function */
|
|
/* destructure props object */
|
|
export default function TableSwitchHead({ tripCalendar }) {
|
|
if (tripCalendar !== undefined) {
|
|
/* return a React element */
|
|
return (
|
|
<thead>
|
|
<TableHead
|
|
tripCalendar={tripCalendar}
|
|
/>
|
|
</thead>
|
|
);
|
|
}
|
|
return <p>loading...</p>;
|
|
}
|
|
|
|
TableSwitchHead.propTypes = {
|
|
tripCalendar: PropTypes.object,
|
|
};
|