"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const lib_1 = require("../../lib");
const core_1 = require("@bluebase/core");
const react_1 = tslib_1.__importDefault(require("react"));
const historyToActionObject_1 = require("../../helpers/historyToActionObject");
/**
 * NavigationActions
 * This is a render prop component which passes the navigation actions
 * to the child component. It's useful when you cannot pass the navigation
 * actions into the component directly, or don't want to pass it in case
 * of a deeply nested child.
 */
exports.NavigationActions = lib_1.withRouter((_a) => {
    var { children } = _a, rest = tslib_1.__rest(_a, ["children"]);
    return (react_1.default.createElement(core_1.BlueBaseConsumer, null, (BB) => {
        const actions = historyToActionObject_1.historyToActionObject(rest, BB);
        return children(actions);
    }));
});
