"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const useViewportType_1 = require("../../useViewportType");
const classNames_1 = require("../../utils/classNames");
const constants_1 = require("../constants");
const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
    const { isMobile } = (0, useViewportType_1.useViewportType)();
    const handleClose = onClose &&
        ((event, reason) => {
            if (disableBackdropClick && reason === 'backdropClick') {
                return;
            }
            onClose(event, reason);
        });
    const { paper, ...restClasses } = classes || {};
    const dialogClasses = {
        paper: (0, classNames_1.classNames)(constants_1.dialogClassnames.paper, paper),
        ...restClasses,
    };
    return { handleClose, isMobile, dialogClasses };
};
exports.useLogic = useLogic;
