Add (WIP) debug mod page

This commit is contained in:
Paul Frazee
2024-02-07 21:26:28 -08:00
parent 270476a126
commit 15d0f2e90b
14 changed files with 523 additions and 17 deletions
+16 -1
View File
@@ -17,6 +17,7 @@ export interface ModerationCauseDescription {
export function describeModerationCause(
cause: ModerationCause | undefined,
context: 'account' | 'content',
labelStrings: LabelStrings,
): ModerationCauseDescription {
// TODO localize
if (!cause) {
@@ -77,7 +78,21 @@ export function describeModerationCause(
description: `You have hidden this post`,
}
}
return cause.labelDef.strings[context].en
if (cause.labelDef.id in labelStrings) {
const strings = labelStrings[cause.labelDef.id as keyof typeof LABELS]
return {
name: context === 'account' ? strings.account.name : strings.content.name,
description:
context === 'account'
? strings.account.description
: strings.content.description,
}
}
return {
name: 'TODO',
description: `TODo`,
}
// return cause.labelDef.strings[context].en
}
export function getProfileModerationCauses(