cleanup, improve date formatting, move date filtering to client side, make statuses more 'airport-y'

This commit is contained in:
Matt Fiddaman
2025-04-01 20:46:26 -04:00
parent 1412825b8d
commit 19cf3e31c5
4 changed files with 39 additions and 36 deletions

View File

@@ -4,6 +4,11 @@ import ScheduleRow from './ScheduleRow';
import ScheduleCell from './ScheduleCell';
const widths = [85, 85, 85, 85, 400, 150];
const colours = {
LANDED: '#6FB165',
ENROUTE: '#3197E5',
CANCELLED: '#E54331',
};
const Schedule = ({ data }) => {
return (
@@ -56,8 +61,8 @@ const Schedule = ({ data }) => {
<ScheduleRow bg={i % 2 === 1} key={row.id}>
<ScheduleCell width={widths[0]}>{row.name}</ScheduleCell>
<ScheduleCell width={widths[1]}>{row.date}</ScheduleCell>
<ScheduleCell width={widths[2]}>{row.start}</ScheduleCell>
<ScheduleCell width={widths[3]}>{row.end}</ScheduleCell>
<ScheduleCell width={widths[2]}>{row.startTime}</ScheduleCell>
<ScheduleCell width={widths[3]}>{row.endTime}</ScheduleCell>
<ScheduleCell width={widths[4]}>
{row.description?.length
? row.description
@@ -69,15 +74,7 @@ const Schedule = ({ data }) => {
<ScheduleCell width={widths[5]}>{row.location}</ScheduleCell>
<ScheduleCell
end="true"
color={
row.status.toUpperCase() === 'COMPLETED'
? '#6FB165'
: row.status.toUpperCase() === 'IN PROGRESS'
? '#3197E5'
: row.status.toUpperCase() === 'CANCELLED'
? '#E54331'
: undefined
}
color={colours[row.status.toUpperCase()]}
>
{row.status}
</ScheduleCell>