import { useContext } from 'react';
import { ConfigContext } from '../../ConfigProvider';
import { useLoadingState } from '../../useLoadingState';
export const useLogic = ({ isSmoothLoading: propsIsSmoothLoading, isLoading, }) => {
    const { imagesMap, components } = useContext(ConfigContext);
    const isSmoothLoading = propsIsSmoothLoading ??
        components?.contentState?.defaultProps?.isSmoothLoading;
    const { isShowLoader, isLoadingPhase } = useLoadingState(isLoading);
    return {
        imagesMap,
        isShowLoader: isSmoothLoading ? isShowLoader : isLoading,
        isLoadingPhase: isSmoothLoading ? isLoadingPhase : isLoading,
    };
};
