// filepath: frontend/src/pages/TripChecklist.tsx import React, { useState, useEffect } from "react"; import { useParams } from "react-router-dom"; import { getTripItems, toggleTripItem } from "../api"; export default function TripChecklist({ trips }: { trips: any[] }) { const { id } = useParams(); const [items, setItems] = useState([]); useEffect(() => { if (id) { getTripItems(id).then(setItems); } }, [id]); const trip = trips.find((t) => t.id === id); if (!trip) return
Trip not found
; return (

{trip.name}

{trip.start_date} – {trip.end_date}

); }