import React from "react";
import Dropdown from "../Dropdown/Dropdown";
import DropdownUtil from "../../Utils/Dropdown";
import RollingTime from "../../../Types/RollingTime/RollingTime";
const RollingTimePicker = (props) => {
    const dropdownOptions = DropdownUtil.getDropdownOptionsFromEnum(RollingTime);
    const currentDropdownOption = dropdownOptions.find((option) => {
        return option.value === props.value;
    });
    return (React.createElement(Dropdown, { value: currentDropdownOption, onChange: (value) => {
            let selectedOption = dropdownOptions.find((option) => {
                return option.value === value;
            });
            if (!selectedOption) {
                selectedOption = dropdownOptions[0];
            }
            if (props.onChange) {
                props.onChange(selectedOption.value);
            }
        }, options: dropdownOptions }));
};
export default RollingTimePicker;
//# sourceMappingURL=RollingTimePicker.js.map