import { getActiveJourneyValue } from '../../utils/sessionHelper.js';
import { getRouteLocals } from '../../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 } = getRouteLocals(res);
    const reportIsBookmarked = getActiveJourneyValue(req, { id, reportId }, 'reportIsBookmarked');
    if (reportIsBookmarked) {
        linkText = 'Remove bookmark';
        linkType = 'remove';
    }
    return {
        bookmarkActionEndpoint,
        showBookmark,
        linkText,
        linkType,
    };
};

export { setUpBookmark };
//# sourceMappingURL=utils.js.map
