Components
All major components, their responsibilities, props, and where they're used.
HeroSection
src/components/HeroSection.tsxLanding page with animated entrance, app branding, and "Plan a trip" CTA.
Props
| Name | Type | Description |
|---|---|---|
| onStart | () => void | Called when user taps "Plan a trip" |
AirbnbSearchBar
src/components/AirbnbSearchBar.tsxDesktop 3-segment header search pill (Where / When / Advanced). Submitting generates the trip and routes into the planner. Replaces the removed TripSetupWizard modal.
Props
| Name | Type | Description |
|---|---|---|
| onSearch | (data: TripSetupData) => void | Called with setup data when the user submits the pill |
MobileLandingSearchBar
src/components/MobileLandingSearchBar.tsxMobile/tablet variant of the header search bar — full-width segmented sheet with the same Where / When / Advanced flow.
Props
| Name | Type | Description |
|---|---|---|
| onSearch | (data: TripSetupData) => void | Called with setup data when the user submits |
PlannerSearchBar
src/components/PlannerSearchBar.tsxSame 3-segment pill, bound to the active Trip. Lets the user rename the trip, re-pick dates, and edit advanced settings without re-running setup.
Props
| Name | Type | Description |
|---|---|---|
| trip | Trip | Current trip |
| onUpdate | (trip: Trip) => void | Persists the edited trip |
GooglePlacesInput
src/components/GooglePlacesInput.tsxGoogle Places autocomplete input with session-token rotation. Used inside the search bars and the add-stop dialog.
Props
| Name | Type | Description |
|---|---|---|
| placeholder | string? | Input placeholder text |
| value | string | Current value (synced to uncontrolled input) |
| onChange | (value: string) => void | Called on text change or place selection |
| onPlaceSelected | (place: PlaceResult) => void? | Optional callback with full place data |
MapPlanner
src/components/MapPlanner.tsxMain planner screen: full-screen map + floating search + collapsible itinerary sheet + add stop dialog.
Props
| Name | Type | Description |
|---|---|---|
| trip | Trip | The generated trip object |
| onUpdateTrip | (trip: Trip) => void | Callback to update trip state |
| onBack | () => void | Navigate back to setup |
GoogleMapView
src/components/GoogleMap.tsxRenders Google Maps with start/end markers and optional selected location pin.
Props
| Name | Type | Description |
|---|---|---|
| trip | Trip | Trip data for geocoding start/end |
| selectedLocation | { lat, lng, name }? | Optional pin from search |
| className | string? | CSS classes |
ItinerarySidebar
src/components/ItinerarySidebar.tsxDesktop itinerary panel: day pills, metric summary, drag-reorderable stops, and inline stop editing.
Props
| Name | Type | Description |
|---|---|---|
| trip | Trip | Trip data |
| onAddStop | (dayIndex: number) => void | Open add stop dialog for a day |
| onRemoveStop | (dayIndex: number, stopId: string) => void | Remove a stop |
MobileItineraryBottomSheet
src/components/MobileItineraryBottomSheet.tsxMobile swipeable bottom sheet variant of the itinerary, including the AI co-pilot toggle.
Props
| Name | Type | Description |
|---|---|---|
| trip | Trip | Trip data |
| onAddStop | (dayIndex: number) => void | Open add stop dialog for a day |
| onRemoveStop | (dayIndex: number, stopId: string) => void | Remove a stop |
AddStopDialog
src/components/AddStopDialog.tsxBottom sheet form for adding a stop: location search, type, day, cost, notes, photo.
Props
| Name | Type | Description |
|---|---|---|
| trip | Trip | Trip data for day list |
| initialDay | number | Pre-selected day index |
| initialLocation | string? | Pre-filled location name |
| onClose | () => void | Close the dialog |
| onAdd | (dayIndex: number, stop: TripStop) => void | Submit the new stop |
StopCard
src/components/StopCard.tsxDisplays a single stop with type icon, name, description, and cost.
Props
| Name | Type | Description |
|---|---|---|
| stop | TripStop | Stop data |
| currencySymbol | string | Currency symbol for cost display |
DayCard
src/components/DayCard.tsxCard for a single day showing stats (distance, fuel, cost) and stop list.
Props
| Name | Type | Description |
|---|---|---|
| day | TripDay | Day data |
| units | 'km' | 'miles' | Distance unit |
| currency | string | Currency code |
| currencySymbol | string | Currency symbol |