import { useViewportType } from '../../useViewportType';
import { classNames } from '../../utils/classNames';
import { dialogClassnames } from '../constants';
export const useLogic = ({ onClose, disableBackdropClick, classes, }) => {
    const { isMobile } = useViewportType();
    const handleClose = onClose &&
        ((event, reason) => {
            if (disableBackdropClick && reason === 'backdropClick') {
                return;
            }
            onClose(event, reason);
        });
    const { paper, ...restClasses } = classes || {};
    const dialogClasses = {
        paper: classNames(dialogClassnames.paper, paper),
        ...restClasses,
    };
    return { handleClose, isMobile, dialogClasses };
};
