'use strict';

var sessionHelper = require('../../utils/sessionHelper.js');
var localsHelper = require('../../utils/localsHelper.js');

const setUpBookmark = (res, req, bookmarkService) => {
    const showBookmark = bookmarkService.enabled;
    let linkText = 'Add bookmark';
    let linkType = 'add';
    const { id, reportId } = req.params;
    const { bookmarkActionEndpoint } = localsHelper.getRouteLocals(res);
    const reportIsBookmarked = sessionHelper.getActiveJourneyValue(req, { id, reportId }, 'reportIsBookmarked');
    if (reportIsBookmarked) {
        linkText = 'Remove bookmark';
        linkType = 'remove';
    }
    return {
        bookmarkActionEndpoint,
        showBookmark,
        linkText,
        linkType,
    };
};

exports.setUpBookmark = setUpBookmark;
//# sourceMappingURL=utils.js.map
