import Dropdown from "react-bootstrap/Dropdown";
import DropdownButton from "react-bootstrap/DropdownButton";

const SelectDropdown = (props) => {
  const { titleText, dropDownOptions, handleSelect, className } = props;

  return (
    <DropdownButton className={className} id="dropdown--button" title={`${titleText}`}>
      {dropDownOptions?.map((option, i) => (
        <Dropdown.Item key={i} onClick={() => handleSelect(`${option.value}`)}>
          {`${option.label}`}
        </Dropdown.Item>
      ))}
    </DropdownButton>
  );
};

export default SelectDropdown;
