"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useSelectedDate = void 0;
const utils_1 = require("../utils");
/**
 * Calculate the selected dates
 * If we are in single calendar mode, will use the startDate as selected date
 * Memoized so will only recalculate when selectedDates or mode changes
 */
const useSelectedDate = ({ selectedDates, mode }) => {
    const currentDateTime = (0, utils_1.isFrom)(mode) || (0, utils_1.isExact)(mode) ? selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.startDate : selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.endDate;
    const minSelectedDateTime = (selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.startDate) || undefined;
    const maxSelectedDateTime = (selectedDates === null || selectedDates === void 0 ? void 0 : selectedDates.endDate) || undefined;
    return {
        currentDateTime,
        maxSelectedDateTime,
        minSelectedDateTime,
    };
};
exports.useSelectedDate = useSelectedDate;
//# sourceMappingURL=useSelectedDate.js.map