"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const useViewportType_1 = require("../../useViewportType");
const useLogic = ({ actions, onClose }) => {
    const { isMobile } = (0, useViewportType_1.useViewportType)();
    const { cancel } = actions;
    const isShowCancelButton = Boolean(cancel);
    const cancelVariant = isMobile ? 'light' : 'text';
    const handleCancelClick = cancel?.onClick || onClose;
    const { variant = cancelVariant } = cancel || {};
    const cancelButtonProps = {
        variant,
        onClick: handleCancelClick,
    };
    return { isShowCancelButton, cancelButtonProps };
};
exports.useLogic = useLogic;
