mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 07:30:04 +00:00
1b51181930
The bookings model moves from the phone tabs into components/Planner/bookings, so both shells read the same sections, traveller predicate and type colours. The phone bookings and transports tabs had the same traveller filter and folded sections twice; that state now lives once in useReservationListFilter, which only those two tabs use. The desktop panel keeps its own filters in useBookingsView because it remembers them for the session. The status switch and the delete on a booking card stay per shell. The desktop hook renders its ConfirmDialog and awaits the delete, the phone asks in an MConfirmSheet and lets the delete run on its own; sharing them would change when the question closes.
12 lines
504 B
TypeScript
12 lines
504 B
TypeScript
import { openFile } from '../../../utils/fileDownload';
|
|
|
|
/**
|
|
* Opens a file attached to a booking. The desktop panel passes `onError` to say
|
|
* so with a toast when the file cannot be opened; the phone's bookings and
|
|
* transports cards pass nothing and stay silent, as they always have.
|
|
*/
|
|
export function openAttachment(f: { url: string; original_name: string }, onError?: () => void): void {
|
|
const opening = openFile(f.url, f.original_name);
|
|
void (onError ? opening.catch(onError) : opening);
|
|
}
|