import { AlertTriangle, Footprints } from 'lucide-react'; import { useTranslation } from '../../../i18n'; import { useSettingsStore } from '../../../store/settingsStore'; import { formatClockTime } from '../../../utils/formatters'; import { fs } from '../../shared/DialogShell'; import { TourNotice } from '../tourParts'; import type { WalkLate, WalkTransitContext } from './walkTransit'; function useIs12h(): boolean { return useSettingsStore((state) => state.settings.time_format) === '12h'; } /** * CW-08: what the search between two city walks goes by, above it: when the * first walk ends, at the earliest where a time of it is not known, that it * ends after midnight, or that the end is not known, and then a time is to be * chosen; and when the next one starts. */ export function WalkTransitNote({ walk }: { walk: WalkTransitContext | null }) { const { t } = useTranslation(); const is12h = useIs12h(); if (!walk) return null; const params = { walk: walk.fromWalk, time: formatClockTime(walk.ends, is12h) }; let end = t('tours.walk.transit.ends', params); if (walk.endsNextDay) end = t('tours.walk.transit.endsNextDay', params); else if (!walk.ends) end = t('tours.walk.transit.endUnknown', params); else if (walk.endsAtLeast) end = t('tours.walk.transit.endsAtLeast', params); return ( }>
{end}
{walk.nextStarts && (
{t('tours.walk.transit.nextStarts', { walk: walk.toWalk, time: formatClockTime(walk.nextStarts, is12h) })}
)}
); } /** * CW-08: a connection, or a journey saved before, that arrives after the next * walk starts. Said on one line that wraps; nothing is moved or replaced. */ export function WalkLateLine({ late }: { late?: WalkLate | null }) { const { t } = useTranslation(); const is12h = useIs12h(); if (!late) return null; return (
); }