From 53728b468b76c1460784b1d53b2c8d06864cdcae Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 3 Oct 2025 15:26:26 -0500 Subject: [PATCH] Replace consts and maps using exported values --- .../moderation/ReportDialog/const.ts | 128 +++++++++++++++ .../moderation/ReportDialog/index.tsx | 6 +- .../moderation/ReportDialog/state.ts | 16 +- .../ReportDialog/utils/useReportOptions.ts | 154 ++++++------------ 4 files changed, 192 insertions(+), 112 deletions(-) diff --git a/src/components/moderation/ReportDialog/const.ts b/src/components/moderation/ReportDialog/const.ts index 0f3fdbfacf..b317f6cb25 100644 --- a/src/components/moderation/ReportDialog/const.ts +++ b/src/components/moderation/ReportDialog/const.ts @@ -1,2 +1,130 @@ +import * as RootReportDefs from '@atproto/api/dist/client/types/com/atproto/moderation/defs' +import * as OzoneReportDefs from '@atproto/api/dist/client/types/tools/ozone/report/defs' + export const DMCA_LINK = 'https://bsky.social/about/support/copyright' export const SUPPORT_PAGE = 'https://bsky.social/about/support' + +export const NEW_TO_OLD_REASON_MAPPING: Record = {} + +/** + * Mapping of new (Ozone namespace) reason types to old reason types. + * + * Matches the mapping defined in the Ozone codebase: + * @see https://github.com/bluesky-social/atproto/blob/09439d7d688294ad1a0c78a74b901ba2f7c5f4c3/packages/ozone/src/mod-service/profile.ts#L15 + */ +export const NEW_TO_OLD_REASONS_MAP: Record< + OzoneReportDefs.ReasonType, + RootReportDefs.ReasonType +> = { + [OzoneReportDefs.REASONAPPEAL]: RootReportDefs.REASONAPPEAL, + + // Violence-related + [OzoneReportDefs.REASONVIOLENCEANIMALWELFARE]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCETHREATS]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCEGRAPHICCONTENT]: + RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCESELFHARM]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCEGLORIFICATION]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT]: + RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCETRAFFICKING]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONVIOLENCEOTHER]: RootReportDefs.REASONVIOLATION, + + // Sexual-related + [OzoneReportDefs.REASONSEXUALABUSECONTENT]: RootReportDefs.REASONSEXUAL, + [OzoneReportDefs.REASONSEXUALNCII]: RootReportDefs.REASONSEXUAL, + [OzoneReportDefs.REASONSEXUALSEXTORTION]: RootReportDefs.REASONSEXUAL, + [OzoneReportDefs.REASONSEXUALDEEPFAKE]: RootReportDefs.REASONSEXUAL, + [OzoneReportDefs.REASONSEXUALANIMAL]: RootReportDefs.REASONSEXUAL, + [OzoneReportDefs.REASONSEXUALUNLABELED]: RootReportDefs.REASONSEXUAL, + [OzoneReportDefs.REASONSEXUALOTHER]: RootReportDefs.REASONSEXUAL, + + // Child safety + [OzoneReportDefs.REASONCHILDSAFETYCSAM]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONCHILDSAFETYGROOM]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONCHILDSAFETYMINORPRIVACY]: + RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONCHILDSAFETYENDANGERMENT]: + RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONCHILDSAFETYHARASSMENT]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONCHILDSAFETYPROMOTION]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONCHILDSAFETYOTHER]: RootReportDefs.REASONVIOLATION, + + // Harassment + [OzoneReportDefs.REASONHARASSMENTTROLL]: RootReportDefs.REASONRUDE, + [OzoneReportDefs.REASONHARASSMENTTARGETED]: RootReportDefs.REASONRUDE, + [OzoneReportDefs.REASONHARASSMENTHATESPEECH]: RootReportDefs.REASONRUDE, + [OzoneReportDefs.REASONHARASSMENTDOXXING]: RootReportDefs.REASONRUDE, + [OzoneReportDefs.REASONHARASSMENTOTHER]: RootReportDefs.REASONRUDE, + + // Misleading + [OzoneReportDefs.REASONMISLEADINGSPAM]: RootReportDefs.REASONSPAM, + [OzoneReportDefs.REASONMISLEADINGBOT]: RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONMISLEADINGIMPERSONATION]: + RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONMISLEADINGSCAM]: RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONMISLEADINGSYNTHETICCONTENT]: + RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONMISLEADINGMISINFORMATION]: + RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONMISLEADINGOTHER]: RootReportDefs.REASONMISLEADING, + + // Map all rule-related reasons to REASONVIOLATION + [OzoneReportDefs.REASONRULESITESECURITY]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONRULESTOLENCONTENT]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONRULEPROHIBITEDSALES]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONRULEBANEVASION]: RootReportDefs.REASONVIOLATION, + [OzoneReportDefs.REASONRULEOTHER]: RootReportDefs.REASONVIOLATION, + + // Information Integrity + [OzoneReportDefs.REASONCIVICELECTORALPROCESS]: + RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONCIVICDISCLOSURE]: RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONCIVICINTERFERENCE]: RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONCIVICMISINFORMATION]: RootReportDefs.REASONMISLEADING, + [OzoneReportDefs.REASONCIVICIMPERSONATION]: RootReportDefs.REASONMISLEADING, +} + +/** + * Mapping of old reason types to new (Ozone namespace) reason types. + * @see https://github.com/bluesky-social/proposals/tree/main/0009-mod-report-granularity#backwards-compatibility + */ +export const OLD_TO_NEW_REASONS_MAP: Record< + Exclude, + OzoneReportDefs.ReasonType +> = { + [RootReportDefs.REASONSPAM]: [OzoneReportDefs.REASONMISLEADINGSPAM], + [RootReportDefs.REASONVIOLATION]: [OzoneReportDefs.REASONRULEOTHER], + [RootReportDefs.REASONMISLEADING]: [OzoneReportDefs.REASONMISLEADINGOTHER], + [RootReportDefs.REASONSEXUAL]: [OzoneReportDefs.REASONSEXUALUNLABELED], + [RootReportDefs.REASONRUDE]: [OzoneReportDefs.REASONHARASSMENTOTHER], + [RootReportDefs.REASONOTHER]: [OzoneReportDefs.REASONRULEOTHER], + [RootReportDefs.REASONAPPEAL]: [OzoneReportDefs.REASONAPPEAL], +} + +/** + * Set of report reasons that should optionally include additional details from + * the reporter. + */ +export const OTHER_REPORT_REASONS: Set = new Set([ + OzoneReportDefs.REASONVIOLENCEOTHER, + OzoneReportDefs.REASONSEXUALOTHER, + OzoneReportDefs.REASONCHILDSAFETYOTHER, + OzoneReportDefs.REASONHARASSMENTOTHER, + OzoneReportDefs.REASONMISLEADINGOTHER, + OzoneReportDefs.REASONRULEOTHER, +]) + +/** + * Set of report reasons that should only be sent to moderation authorities, + * such as Bluesky. + */ +export const MOD_AUTHORITY_ONLY_REPORT_REASONS: Set = + new Set([ + OzoneReportDefs.REASONCHILDSAFETYCSAM, + OzoneReportDefs.REASONCHILDSAFETYGROOM, + OzoneReportDefs.REASONCHILDSAFETYENDANGERMENT, + OzoneReportDefs.REASONCHILDSAFETYPROMOTION, + OzoneReportDefs.REASONCHILDSAFETYOTHER, + OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT, + ]) diff --git a/src/components/moderation/ReportDialog/index.tsx b/src/components/moderation/ReportDialog/index.tsx index 69bb459f62..1f8bfe4d2e 100644 --- a/src/components/moderation/ReportDialog/index.tsx +++ b/src/components/moderation/ReportDialog/index.tsx @@ -36,8 +36,8 @@ import {initialState, reducer} from './state' import {type ReportDialogProps, type ReportSubject} from './types' import {parseReportSubject} from './utils/parseReportSubject' import { + type ReportCategoryConfig, type ReportOption, - type ReportOptionCategory, useReportOptions, } from './utils/useReportOptions' @@ -620,8 +620,8 @@ function CategoryCard({ option, onSelect, }: { - option: ReportOptionCategory - onSelect?: (option: ReportOptionCategory) => void + option: ReportCategoryConfig + onSelect?: (option: ReportCategoryConfig) => void }) { const t = useTheme() const {_} = useLingui() diff --git a/src/components/moderation/ReportDialog/state.ts b/src/components/moderation/ReportDialog/state.ts index 8d510083ce..7b15e174b2 100644 --- a/src/components/moderation/ReportDialog/state.ts +++ b/src/components/moderation/ReportDialog/state.ts @@ -1,13 +1,13 @@ import {type AppBskyLabelerDefs} from '@atproto/api' +import {OTHER_REPORT_REASONS} from '#/components/moderation/ReportDialog/const' import { - OtherReportReasons, + type ReportCategoryConfig, type ReportOption, - type ReportOptionCategory, -} from './utils/useReportOptions' +} from '#/components/moderation/ReportDialog/utils/useReportOptions' export type ReportState = { - selectedCategory?: ReportOptionCategory + selectedCategory?: ReportCategoryConfig selectedOption?: ReportOption selectedLabeler?: AppBskyLabelerDefs.LabelerViewDetailed details?: string @@ -19,7 +19,7 @@ export type ReportState = { export type ReportAction = | { type: 'selectCategory' - option: ReportOptionCategory + option: ReportCategoryConfig otherOption: ReportOption } | { @@ -87,7 +87,7 @@ export function reducer(state: ReportState, action: ReportAction): ReportState { ...state, selectedOption: action.option, activeStepIndex1: 3, - detailsOpen: OtherReportReasons.has(action.option.reason), + detailsOpen: OTHER_REPORT_REASONS.has(action.option.reason), } case 'clearOption': return { @@ -102,7 +102,9 @@ export function reducer(state: ReportState, action: ReportAction): ReportState { ...state, selectedLabeler: action.labeler, activeStepIndex1: 4, - detailsOpen: OtherReportReasons.has(state.selectedOption?.reason), + detailsOpen: state.selectedOption + ? OTHER_REPORT_REASONS.has(state.selectedOption?.reason) + : false, } case 'clearLabeler': return { diff --git a/src/components/moderation/ReportDialog/utils/useReportOptions.ts b/src/components/moderation/ReportDialog/utils/useReportOptions.ts index 1e40bd78cc..3f8142a8c7 100644 --- a/src/components/moderation/ReportDialog/utils/useReportOptions.ts +++ b/src/components/moderation/ReportDialog/utils/useReportOptions.ts @@ -1,4 +1,5 @@ -import {type ReasonType} from '@atproto/api/dist/client/types/com/atproto/moderation/defs' +import * as RootReportDefs from '@atproto/api/dist/client/types/com/atproto/moderation/defs' +import * as OzoneReportDefs from '@atproto/api/dist/client/types/tools/ozone/report/defs' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' @@ -12,7 +13,7 @@ export type ReportCategory = | 'civicIntegrity' | 'other' -export interface ReportOptionCategory { +export type ReportCategoryConfig = { key: ReportCategory title: string description: string @@ -21,37 +22,15 @@ export interface ReportOptionCategory { isOther?: boolean } -export interface ReportOptionCategories { - childSafety: ReportOptionCategory - violencePhysicalHarm: ReportOptionCategory - sexualAdultContent: ReportOptionCategory - harassmentHate: ReportOptionCategory - misleading: ReportOptionCategory - ruleBreaking: ReportOptionCategory - civicIntegrity: ReportOptionCategory - other: ReportOptionCategory -} - -export interface ReportOption { +export type ReportOption = { title: string - reason: ReasonType + reason: RootReportDefs.ReasonType } -export const OtherReportReasons = new Set([ - 'com.atproto.moderation.defs#reasonOther', - 'tools.ozone.report.defs#reasonChildSafetyOther', - 'tools.ozone.report.defs#reasonViolenceOther', - 'tools.ozone.report.defs#reasonSexualOther', - 'tools.ozone.report.defs#reasonHarassmentOther', - 'tools.ozone.report.defs#reasonMisleadingOther', - 'tools.ozone.report.defs#reasonRuleOther', - 'tools.ozone.report.defs#reasonChildSafetyOther', -]) - export function useReportOptions() { const {_} = useLingui() - const categories: ReportOptionCategories = { + const categories: Record = { childSafety: { key: 'childSafety', title: _(msg`Child Safety`), @@ -62,31 +41,31 @@ export function useReportOptions() { options: [ { title: _(msg`Child Sexual Abuse Material (CSAM)`), - reason: 'tools.ozone.report.defs#reasonChildSafetyCSAM', + reason: OzoneReportDefs.REASONCHILDSAFETYCSAM, }, { title: _(msg`Grooming or Predatory Behavior`), - reason: 'tools.ozone.report.defs#reasonChildSafetyGroom', + reason: OzoneReportDefs.REASONCHILDSAFETYGROOM, }, { title: _(msg`Minor Privacy Violation`), - reason: 'tools.ozone.report.defs#reasonChildSafetyMinorPrivacy', + reason: OzoneReportDefs.REASONCHILDSAFETYMINORPRIVACY, }, { title: _(msg`Child Endangerment`), - reason: 'tools.ozone.report.defs#reasonChildSafetyEndangerment', + reason: OzoneReportDefs.REASONCHILDSAFETYENDANGERMENT, }, { title: _(msg`Minor Harassment or Bullying`), - reason: 'tools.ozone.report.defs#reasonChildSafetyHarassment', + reason: OzoneReportDefs.REASONCHILDSAFETYHARASSMENT, }, { title: _(msg`Promotion of Child Exploitation`), - reason: 'tools.ozone.report.defs#reasonChildSafetyPromotion', + reason: OzoneReportDefs.REASONCHILDSAFETYPROMOTION, }, { title: _(msg`Other Child Safety Issue`), - reason: 'tools.ozone.report.defs#reasonChildSafetyOther', + reason: OzoneReportDefs.REASONCHILDSAFETYOTHER, }, ], }, @@ -98,35 +77,35 @@ export function useReportOptions() { options: [ { title: _(msg`Animal Welfare`), - reason: 'tools.ozone.report.defs#reasonViolenceAnimalWelfare', + reason: OzoneReportDefs.REASONVIOLENCEANIMALWELFARE, }, { title: _(msg`Threats or Incitement`), - reason: 'tools.ozone.report.defs#reasonViolenceThreats', + reason: OzoneReportDefs.REASONVIOLENCETHREATS, }, { title: _(msg`Graphic Violent Content`), - reason: 'tools.ozone.report.defs#reasonViolenceGraphicContent', + reason: OzoneReportDefs.REASONVIOLENCEGRAPHICCONTENT, }, { title: _(msg`Self Harm`), - reason: 'tools.ozone.report.defs#reasonViolenceSelfHarm', + reason: OzoneReportDefs.REASONVIOLENCESELFHARM, }, { title: _(msg`Glorification of Violence`), - reason: 'tools.ozone.report.defs#reasonViolenceGlorification', + reason: OzoneReportDefs.REASONVIOLENCEGLORIFICATION, }, { title: _(msg`Extremist Content`), - reason: 'tools.ozone.report.defs#reasonViolenceExtremistContent', + reason: OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT, }, { title: _(msg`Human Trafficking`), - reason: 'tools.ozone.report.defs#reasonViolenceTrafficking', + reason: OzoneReportDefs.REASONVIOLENCETRAFFICKING, }, { title: _(msg`Other Violent Content`), - reason: 'tools.ozone.report.defs#reasonViolenceOther', + reason: OzoneReportDefs.REASONVIOLENCEOTHER, }, ], }, @@ -138,31 +117,31 @@ export function useReportOptions() { options: [ { title: _(msg`Adult Sexual Abuse Content`), - reason: 'tools.ozone.report.defs#reasonSexualAbuseContent', + reason: OzoneReportDefs.REASONSEXUALABUSECONTENT, }, { title: _(msg`Non-Consensual Intimate Imagery`), - reason: 'tools.ozone.report.defs#reasonSexualNCII', + reason: OzoneReportDefs.REASONSEXUALNCII, }, { title: _(msg`Sextortion`), - reason: 'tools.ozone.report.defs#reasonSexualSextortion', + reason: OzoneReportDefs.REASONSEXUALSEXTORTION, }, { title: _(msg`Deepfake Adult Content`), - reason: 'tools.ozone.report.defs#reasonSexualDeepfake', + reason: OzoneReportDefs.REASONSEXUALDEEPFAKE, }, { title: _(msg`Animal Sexual Abuse`), - reason: 'tools.ozone.report.defs#reasonSexualAnimal', + reason: OzoneReportDefs.REASONSEXUALANIMAL, }, { title: _(msg`Unlabeled Adult Content`), - reason: 'tools.ozone.report.defs#reasonSexualUnlabeled', + reason: OzoneReportDefs.REASONSEXUALUNLABELED, }, { title: _(msg`Other Sexual Violence Content`), - reason: 'tools.ozone.report.defs#reasonSexualOther', + reason: OzoneReportDefs.REASONSEXUALOTHER, }, ], }, @@ -176,23 +155,23 @@ export function useReportOptions() { options: [ { title: _(msg`Trolling`), - reason: 'tools.ozone.report.defs#reasonHarassmentTroll', + reason: OzoneReportDefs.REASONHARASSMENTTROLL, }, { title: _(msg`Targeted Harassment`), - reason: 'tools.ozone.report.defs#reasonHarassmentTargeted', + reason: OzoneReportDefs.REASONHARASSMENTTARGETED, }, { title: _(msg`Hate Speech`), - reason: 'tools.ozone.report.defs#reasonHarassmentHateSpeech', + reason: OzoneReportDefs.REASONHARASSMENTHATESPEECH, }, { title: _(msg`Doxxing`), - reason: 'tools.ozone.report.defs#reasonHarassmentDoxxing', + reason: OzoneReportDefs.REASONHARASSMENTDOXXING, }, { title: _(msg`Other Harassing or Hateful Content`), - reason: 'tools.ozone.report.defs#reasonHarassmentOther', + reason: OzoneReportDefs.REASONHARASSMENTOTHER, }, ], }, @@ -204,31 +183,31 @@ export function useReportOptions() { options: [ { title: _(msg`Fake Account or Bot`), - reason: 'tools.ozone.report.defs#reasonMisleadingBot', + reason: OzoneReportDefs.REASONMISLEADINGBOT, }, { title: _(msg`Impersonation`), - reason: 'tools.ozone.report.defs#reasonMisleadingImpersonation', + reason: OzoneReportDefs.REASONMISLEADINGIMPERSONATION, }, { title: _(msg`Spam`), - reason: 'com.atproto.moderation.defs#reasonSpam', + reason: OzoneReportDefs.REASONMISLEADINGSPAM, }, { title: _(msg`Scam`), - reason: 'tools.ozone.report.defs#reasonMisleadingScam', + reason: OzoneReportDefs.REASONMISLEADINGSCAM, }, { title: _(msg`Unlabeled Generative AI or Synthetic Content`), - reason: 'tools.ozone.report.defs#reasonMisleadingSyntheticContent', + reason: OzoneReportDefs.REASONMISLEADINGSYNTHETICCONTENT, }, { title: _(msg`Harmful False Claims`), - reason: 'tools.ozone.report.defs#reasonMisleadingMisinformation', + reason: OzoneReportDefs.REASONMISLEADINGMISINFORMATION, }, { title: _(msg`Other Misleading Content`), - reason: 'tools.ozone.report.defs#reasonMisleadingOther', + reason: OzoneReportDefs.REASONMISLEADINGOTHER, }, ], }, @@ -240,23 +219,23 @@ export function useReportOptions() { options: [ { title: _(msg`Hacking or System Attacks`), - reason: 'tools.ozone.report.defs#reasonRuleSiteSecurity', + reason: OzoneReportDefs.REASONRULESITESECURITY, }, { title: _(msg`Stolen Content`), - reason: 'tools.ozone.report.defs#reasonRuleStolenContent', + reason: OzoneReportDefs.REASONRULESTOLENCONTENT, }, { title: _(msg`Promoting or Selling Prohibited Items or Services`), - reason: 'tools.ozone.report.defs#reasonRuleProhibitedSales', + reason: OzoneReportDefs.REASONRULEPROHIBITEDSALES, }, { title: _(msg`Banned User Returning`), - reason: 'tools.ozone.report.defs#reasonRuleBanEvasion', + reason: OzoneReportDefs.REASONRULEBANEVASION, }, { title: _(msg`Other Network Rule-breaking`), - reason: 'tools.ozone.report.defs#reasonRuleOther', + reason: OzoneReportDefs.REASONRULEOTHER, }, ], }, @@ -270,27 +249,23 @@ export function useReportOptions() { options: [ { title: _(msg`Electoral Process Violations`), - reason: 'tools.ozone.report.defs#reasonCivicElectoralProcess', + reason: OzoneReportDefs.REASONCIVICELECTORALPROCESS, }, { title: _(msg`Disclosure and Transparency Violations`), - reason: 'tools.ozone.report.defs#reasonCivicDisclosure', + reason: OzoneReportDefs.REASONCIVICDISCLOSURE, }, { title: _(msg`Voter Intimidation or Interference`), - reason: 'tools.ozone.report.defs#reasonCivicInterference', + reason: OzoneReportDefs.REASONCIVICINTERFERENCE, }, { title: _(msg`Election Misinformation`), - reason: 'tools.ozone.report.defs#reasonCivicMisinformation', + reason: OzoneReportDefs.REASONCIVICMISINFORMATION, }, { title: _(msg`Impersonation of Electoral Officials or Entities`), - reason: 'tools.ozone.report.defs#reasonCivicImpersonation', - }, - { - title: _(msg`Other Civic Integrity Issue`), - reason: 'tools.ozone.report.defs#reasonViolenceOther', + reason: OzoneReportDefs.REASONCIVICIMPERSONATION, }, ], }, @@ -302,7 +277,7 @@ export function useReportOptions() { options: [ { title: _(msg`Other`), - reason: 'com.atproto.moderation.defs#reasonOther', + reason: RootReportDefs.REASONOTHER, }, ], isOther: true, @@ -310,7 +285,7 @@ export function useReportOptions() { } const sortedCategories = ( - Object.values(categories) as ReportOptionCategory[] + Object.values(categories) as ReportCategoryConfig[] ).sort((a, b) => a.sort - b.sort) const getCategory = (reasonName: ReportCategory) => { @@ -319,28 +294,3 @@ export function useReportOptions() { return {categories, sortedCategories, getCategory} } - -const DeprecatedReportReasonMapping: Partial> = { - 'tools.ozone.report.defs#reasonMisleadingSpam': - 'com.atproto.moderation.defs#reasonSpam', - 'tools.ozone.report.defs#reasonRuleOther': - 'com.atproto.moderation.defs#reasonViolation', - 'tools.ozone.report.defs#reasonMisleadingOther': - 'com.atproto.moderation.defs#reasonMisleading', - 'tools.ozone.report.defs#reasonSexualUnlabeled': - 'com.atproto.moderation.defs#reasonSexual', - 'tools.ozone.report.defs#reasonHarassmentOther': - 'com.atproto.moderation.defs#reasonRude', - 'tools.ozone.report.defs#reasonAppeal': - 'com.atproto.moderation.defs#reasonAppeal', -} - -export function newReportReasonToDeprecatedReason( - newReason: ReasonType, -): ReasonType { - const maybeReason = DeprecatedReportReasonMapping[newReason] - if (maybeReason) { - return maybeReason - } - return 'com.atproto.moderation.defs#reasonOther' -}