import { useContext, useMemo } from 'react';
import { entityPageContext } from '../providers';
export function useWidgetPageStatus(widgetStatus) {
    const pageState = useContext(entityPageContext);
    const pageStatus = pageState?.initTask.status.status;
    const status = useMemo(() => (!pageState || pageStatus === 'success' ? widgetStatus : pageStatus), [pageStatus, widgetStatus]);
    return { status };
}
//# sourceMappingURL=useWidgetPageStatus.js.map