Files
TREK/client/src/components/Tours/paddle/PaddleCheckSection.tsx
T
Maurice de86e6383a feat(tours): the obstacle checklist, the decision panel and the safety note in the planner
PAD-06 and PAD-09 on screen. A paddle tour open in the planner or shown as
recorded carries a checklist card: the obstacles of the data along its
route in route order with the paddler's own portages and locks among them,
each with its status, its paddling rule and the SUP advice at a lock, and
the earlier decisions the route or the data no longer carries behind a
fold. A row moves the camera onto the obstacle and the other parts of its
lock and opens its card on the map, where the decision panel sits: four
choices, the notices that stay after a choice (a ban, the SUP advice, a
portage still to plan), the date of the last check on site, a note and who
decided when. An object the map does not hold opens in a dialog instead.
Deciding waits while the route has unsaved changes, and a stale or dirty
list is dimmed, never hidden.

The tours list, the desktop day plan and the phone day plan show the bench
as one pill, the tour detail shows it with the data's date, and every paddle
tour reaches the safety note from its footer. Nothing reads as safe where
TREK knows nothing, and nothing blocks.
2026-10-17 01:16:41 +00:00

37 lines
1.3 KiB
TypeScript

import type { TourListItem } from '@trek/shared';
import { useTranslation } from '../../../i18n';
import { BOX } from '../../Planner/bookings/bookingParts';
import { DialogSection } from '../../shared/DialogShell';
import { PaddleCheckDataLine, PaddleCheckPill } from './PaddleCheckBadges';
import { PaddleSafetyRow } from './PaddleSafety';
/**
* The checklist of a paddle tour in its detail (PAD-09): the check bench as
* the day plan shows it and how current its data is, then the safety note.
* A tour without a bench yet shows the safety note alone.
*/
export function PaddleCheckSection({ tour }: { tour: TourListItem }) {
const { t } = useTranslation();
const check = tour.paddle_check ?? null;
if (!check) {
return (
<div className="flex-none">
<PaddleSafetyRow />
</div>
);
}
return (
<DialogSection className="flex-none" label={t('tours.paddle.check.title')}>
<div className="flex flex-col gap-2">
<div data-testid="paddle-check-summary" className={`${BOX} flex flex-col gap-2 px-3 py-2.5`}>
<div className="flex flex-wrap items-center gap-1">
<PaddleCheckPill check={check} />
</div>
<PaddleCheckDataLine check={check} />
</div>
<PaddleSafetyRow />
</div>
</DialogSection>
);
}