fix(mobile): share the bookings tabs' sections, and fit two tests to the sheets they test

Both bookings tabs built the same status sections; listSections in the shared
filter hook now does it once. The photo sort test looks for the sheet in the
document, as the sheet is portalled to the body, and the saved place test
expects the notes the sheet now sends.
This commit is contained in:
Maurice
2026-11-27 23:39:30 +01:00
parent 1fa5c8cec2
commit 8b008a74fe
5 changed files with 26 additions and 19 deletions
@@ -1,7 +1,20 @@
import { useState } from 'react';
import type { Day, Reservation } from '../../../types';
import { groupTransports, onTravelers } from './bookingsModel';
import { groupTransports, onTravelers, type StatusGroups } from './bookingsModel';
/**
* The status sections both tabs list, in their order, leaving out the empty ones.
* Bookings never fill `transit`, so that section only ever shows among transports.
*/
export function listSections(groups: StatusGroups, t: (key: string) => string) {
return [
{ id: 'confirmed', label: t('reservations.confirmed'), rows: groups.confirmed },
{ id: 'pending', label: t('reservations.pending'), rows: groups.pending },
{ id: 'transit', label: t('reservations.type.transit'), rows: groups.transit },
{ id: 'past', label: t('reservations.past'), rows: groups.past },
].filter((s) => s.rows.length > 0);
}
/**
* The traveller filter and the folded sections of the phone's bookings and