"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const utils_1 = require("../utils");
const types_1 = require("../../types");
function Time({ step = 30, onChangeTime, min, max, setIsCalendarVisible, hideDisable = false }) {
    const timeSteps = (0, utils_1.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_1.default.createElement("div", null,
        react_1.default.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_1.default.createElement("p", { onClick: () => handleChange(item), className: (0, types_1.classNames)('text-xs p-2 rounded-lg', item.disable ? 'text-gray-400' : 'hover:bg-gray-100 cursor-pointer'), key: item.time }, item.time))))));
}
exports.default = Time;
//# sourceMappingURL=Time.js.map