import React from 'react';
import { generateTimeStepsWithMinMaxValue } from '../utils';
import { classNames } from '../../types';
function Time({ step = 30, onChangeTime, min, max, setIsCalendarVisible, hideDisable = false }) {
    const timeSteps = generateTimeStepsWithMinMaxValue(step, min, max, hideDisable);
    const handleChange = (time) => {
        if (onChangeTime && !time.disable) {
            onChangeTime(time.time);
            setIsCalendarVisible === null || setIsCalendarVisible === void 0 ? void 0 : setIsCalendarVisible(false);
        }
    };
    return (React.createElement("div", null,
        React.createElement("div", { className: 'bg-white py-2 px-3 rounded-lg shadow-lg max-h-[17rem] overflow-y-auto border border-gray-300' }, timeSteps.map((item) => (React.createElement("p", { onClick: () => handleChange(item), className: classNames('text-xs p-2 rounded-lg', item.disable ? 'text-gray-400' : 'hover:bg-gray-100 cursor-pointer'), key: item.time }, item.time))))));
}
export default Time;
//# sourceMappingURL=Time.js.map