"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useSingleDatePicker = void 0;
const react_1 = require("react");
const useBaseDatePicker_1 = __importDefault(require("../../BaseDatePicker/hooks/useBaseDatePicker"));
const index_util_1 = require("./index.util");
const types_1 = require("../../../../types");
const INIT_SELECTED_DATA = types_1.EMPTY_DATE;
const useSingleDatePicker = (props) => {
    const baseDatePicker = (0, useBaseDatePicker_1.default)(props);
    const dateList = (0, react_1.useMemo)(() => {
        const dates = baseDatePicker.dateList;
        return (0, index_util_1.convertDatesWithSingleDatePickerFeatures)({
            dates,
            disabledDates: props.disabledDates,
            selectedDate: props.selectedDate,
            colorType: props.colorType,
            handleClickDate: props.onUpdateSelectedDate,
        });
    }, [props, baseDatePicker.dateList]);
    const resetSelectedData = () => {
        props.onUpdateSelectedDate(INIT_SELECTED_DATA);
    };
    return Object.assign(Object.assign({}, baseDatePicker), { dateList,
        resetSelectedData });
};
exports.useSingleDatePicker = useSingleDatePicker;
