Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

841 B
Raw Blame
import type { DayPlanSidebarProps } from './DayPlanSidebar';

/**
 * The day plan's props with the optional ones filled in. The plan's hook and its
 * view both read the props through this, so the fallbacks are written once.
 */
export function withDayPlanDefaults(props: DayPlanSidebarProps) {
  const {
    accommodations = [],
    reservations = [],
    visibleConnectionIds = [],
    allConnectionsShown = false,
    routeShown = false,
    routeProfile = 'driving',
    canUndo = false,
    lastActionLabel = null,
    showRouteToolsWhenExpanded = false,
    isMobile = false,
    ...rest
  } = props;
  return {
    ...rest,
    accommodations,
    reservations,
    visibleConnectionIds,
    allConnectionsShown,
    routeShown,
    routeProfile,
    canUndo,
    lastActionLabel,
    showRouteToolsWhenExpanded,
    isMobile,
  };
}