"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const react_1 = require("react");
const ConfigProvider_1 = require("../../ConfigProvider");
const useLoadingState_1 = require("../../useLoadingState");
const useLogic = ({ isSmoothLoading: propsIsSmoothLoading, isLoading, }) => {
    const { imagesMap, components } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
    const isSmoothLoading = propsIsSmoothLoading ??
        components?.contentState?.defaultProps?.isSmoothLoading;
    const { isShowLoader, isLoadingPhase } = (0, useLoadingState_1.useLoadingState)(isLoading);
    return {
        imagesMap,
        isShowLoader: isSmoothLoading ? isShowLoader : isLoading,
        isLoadingPhase: isSmoothLoading ? isLoadingPhase : isLoading,
    };
};
exports.useLogic = useLogic;
