import RecentReportslistUtils from '../../../../../components/user-reports/viewed/utils.js';
import UserReportsListUtils from '../../../../../components/user-reports/utils.js';
import localsHelper from '../../../../../utils/localsHelper.js';

class RecentlyViewedReportsListController {
    layoutPath;
    services;
    constructor(layoutPath, services) {
        this.layoutPath = layoutPath;
        this.services = services;
    }
    GET = async (_req, res) => {
        const { recentlyViewedReports } = localsHelper.getValues(res);
        const listParams = await UserReportsListUtils.renderList({
            reportsData: recentlyViewedReports,
            filterFunction: RecentReportslistUtils.filterReports,
            res,
            type: 'viewed',
        });
        res.render(`dpr/routes/journeys/my-reports/view`, {
            title: 'Recently viewed reports',
            id: 'recently-viewed-reports-list',
            layoutPath: this.layoutPath,
            ...listParams,
        });
    };
}

export { RecentlyViewedReportsListController, RecentlyViewedReportsListController as default };
//# sourceMappingURL=controller.js.map
