blob: 57278eea9dedddc458a5b050143cb3561aed9615 [file] [log] [blame]
Adrià Vilanova Martínez0d92a0c2023-11-06 01:37:20 +01001import {getDisplayLanguage} from '../../utils/common.js';
2import PerForumStatsSection from '../../utils/PerForumStatsSection.js';
3
4import BaseExtraInfoInjection from './base.js';
5
6export default class ProfilePerForumStatsExtraInfoInjection extends
7 BaseExtraInfoInjection {
8 constructor(infoHandler, optionsWatcher) {
9 super(infoHandler, optionsWatcher);
10 this.displayLanguage = getDisplayLanguage();
11 }
12
13 async isEnabled() {
14 return await this.optionsWatcher.isEnabled('perforumstats');
15 }
16
17 inject(profileInfo, injectionDetails) {
18 new PerForumStatsSection(
19 injectionDetails.chart?.parentNode, profileInfo.body,
20 this.displayLanguage, /* isCommunityConsole = */ true);
21 }
22}