import React from 'react';
import { useSearchParams } from 'react-router-dom';
import MyTrips from './MyTrips';
import TripPlanner from './TripPlanner';

const PlannerWrapper = () => {
  const [searchParams] = useSearchParams();
  const tripId = searchParams.get('trip_id');

  // Eğer trip_id varsa TripPlanner'ı göster, yoksa MyTrips'i göster
  if (tripId) {
    return <TripPlanner />;
  }

  return <MyTrips />;
};

export default PlannerWrapper;
