"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const hooks_1 = require("./hooks");
const useLogic = ({ onClick, renderDayContent, onDayHover, monthDay, date, isInSelectedRange, isSelected, isDisabled, dragAndDropProps, }) => {
    const handleMouseEnter = onDayHover ? () => onDayHover?.(date) : undefined;
    const handleRenderDayContent = renderDayContent
        ? renderDayContent
        : () => monthDay;
    const handleOnClick = onClick ? () => onClick?.(date) : undefined;
    const component = !onClick ? 'time' : undefined;
    const isNotInteractable = !onClick;
    const dragAndDropHandlers = (0, hooks_1.useDragAndDropHandlers)({
        dragAndDropProps,
        isDisabled,
        date,
        isInSelectedRange,
        isSelected,
    });
    return {
        handleMouseEnter,
        handleRenderDayContent,
        handleOnClick,
        component,
        isNotInteractable,
        ...dragAndDropHandlers,
    };
};
exports.useLogic = useLogic;
