import RoomFilter from "../RoomFilter"
import RoomList from "../RoomList"

import type { RoomSelectionPanelProps } from "@/types/components/hotelReservation/selectRate/roomSelection"

export function RoomSelectionPanel({
  rooms,
  roomCategories,
  availablePackages,
  selectedPackages,
  setSelectedRate,
  hotelType,
  handleFilter,
  defaultPackages,
  roomListIndex,
}: RoomSelectionPanelProps) {
  return (
    <>
      <RoomFilter
        numberOfRooms={rooms.roomConfigurations.length}
        onFilter={handleFilter}
        filterOptions={defaultPackages}
        roomListIndex={roomListIndex}
      />
      <RoomList
        roomsAvailability={rooms}
        roomCategories={roomCategories}
        availablePackages={availablePackages}
        selectedPackages={selectedPackages}
        setRateCode={setSelectedRate}
        hotelType={hotelType}
        roomListIndex={roomListIndex}
      />
    </>
  )
}
