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.

605 B
Raw Blame
import { create } from 'zustand';

/**
 * The day a swipe is heading for, before the pager has settled on it. The day
 * rail in the trip header lights that chip at once, the way a native tab strip
 * follows the finger, while the plan itself switches only when the snap lands
 * (MDayPager's onSelectDay). Null when no swipe is under way.
 */
interface DayPreviewState {
  dayId: number | null;
  setDayId: (dayId: number | null) => void;
}

export const useDayPreviewStore = create<DayPreviewState>((set) => ({
  dayId: null,
  setDayId: (dayId) => set((s) => (s.dayId === dayId ? s : { dayId })),
}));