Remove dead code and start moving toward latest modsdk

This commit is contained in:
Paul Frazee
2024-02-29 16:51:37 -08:00
parent 05863426c5
commit ad135fa705
24 changed files with 87 additions and 1179 deletions
@@ -1,4 +1,4 @@
import {ModerationCause} from '@atproto/api'
import {ModerationCause, LABELS} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useLabelStrings} from './useLabelStrings'
@@ -76,8 +76,9 @@ export function useModerationCauseDescription(
}
}
if (cause.type === 'label') {
if (cause.labelDef.id in labelStrings) {
const strings = labelStrings[cause.labelDef.id]
if (cause.labelDef.identifier in labelStrings) {
const strings =
labelStrings[cause.labelDef.identifier as keyof typeof LABELS]
return {
name:
context === 'account' ? strings.account.name : strings.content.name,
@@ -88,8 +89,8 @@ export function useModerationCauseDescription(
}
}
return {
name: cause.labelDef.id,
description: _(msg`Labeled ${cause.labelDef.id}`),
name: cause.labelDef.identifier,
description: _(msg`Labeled ${cause.labelDef.identifier}`),
}
}
// should never happen