import React from 'react';
import { ExtendedFlightSearchResponseItem, FlightSelectionMode } from '../../../types';
import PairedFlightSelection from './paired-flight-selection';
import IndependentFlightSelection from './independent-flight-selection';

interface FlightSelectionProps {
  searchResults: ExtendedFlightSearchResponseItem[];
  flightSelectionType: FlightSelectionMode;
}

const FlightSelection: React.FC<FlightSelectionProps> = ({ searchResults, flightSelectionType }) => {
  return flightSelectionType === 'paired' ? (
    <PairedFlightSelection searchResults={searchResults} />
  ) : (
    <IndependentFlightSelection searchResults={searchResults} />
  );
};

export default FlightSelection;
