import { Hotel } from 'lucide-react'
import type { RouteSegment } from '../../types'
import { fs } from '../shared/DialogShell'
import { routeModeIcon } from './routeModes'
/** The leg's figures as one quiet pill: mode, time, distance and a router note, side by side. */
function LegPill({ seg, profile }: { seg: RouteSegment; profile: string }) {
// The leg's own mode (#1281) wins over the day-wide fallback for icon + text.
const effProfile = seg.mode ?? profile
const driving = effProfile !== 'walking'
const Icon = routeModeIcon(effProfile)
return (
{seg.durationText ?? (driving ? seg.drivingText : seg.walkingText)}
{seg.distanceText}
{seg.noteText && {seg.noteText}}
)
}
const LINE = 'h-px min-w-3 flex-1 bg-edge-faint'
/** Slim travel-time connector shown between two consecutive located stops in a day. */
export function RouteConnector({ seg, profile }: { seg: RouteSegment; profile: string }) {
return (
)
}
/**
* The hotel's bookend legs for a day: a two-line connector naming the day's
* accommodation with the drive to/from it. Rendered above the first place (the
* morning departure from the hotel) and below the last place (the evening return),
* when the "optimize from accommodation" setting is on and the day has a hotel.
*/
export function HotelRouteConnector({
seg,
profile,
name,
placement,
}: {
seg: RouteSegment
profile: string
name: string
placement: 'top' | 'bottom'
}) {
const hotelRow = (
{name}
)
const travelRow = (
)
return (
{placement === 'top' ? (
<>
{hotelRow}
{travelRow}
>
) : (
<>
{travelRow}
{hotelRow}
>
)}
)
}