about summary refs log tree commit diff
path: root/src/components/moderation/ReportDialog/utils/useReportOptions.ts
blob: 38888d51a49a9622434c9448eaae86a4372d7252 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import {useMemo} from 'react'
import {ComAtprotoModerationDefs} from '@atproto/api'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'

export interface ReportOption {
  reason: string
  title: string
  description: string
}

interface ReportOptions {
  account: ReportOption[]
  post: ReportOption[]
  list: ReportOption[]
  starterPack: ReportOption[]
  feed: ReportOption[]
  chatMessage: ReportOption[]
}

export function useReportOptions(): ReportOptions {
  const {_} = useLingui()

  return useMemo(() => {
    const other = {
      reason: ComAtprotoModerationDefs.REASONOTHER,
      title: _(msg`Other`),
      description: _(msg`An issue not included in these options`),
    }
    const common = [
      {
        reason: ComAtprotoModerationDefs.REASONRUDE,
        title: _(msg`Anti-Social Behavior`),
        description: _(msg`Harassment, trolling, or intolerance`),
      },
      {
        reason: ComAtprotoModerationDefs.REASONVIOLATION,
        title: _(msg`Illegal and Urgent`),
        description: _(msg`Glaring violations of law or terms of service`),
      },
      other,
    ]
    return {
      account: [
        {
          reason: ComAtprotoModerationDefs.REASONMISLEADING,
          title: _(msg`Misleading Account`),
          description: _(
            msg`Impersonation or false claims about identity or affiliation`,
          ),
        },
        {
          reason: ComAtprotoModerationDefs.REASONSPAM,
          title: _(msg`Frequently Posts Unwanted Content`),
          description: _(msg`Spam; excessive mentions or replies`),
        },
        {
          reason: ComAtprotoModerationDefs.REASONVIOLATION,
          title: _(msg`Name or Description Violates Community Standards`),
          description: _(msg`Terms used violate community standards`),
        },
        other,
      ],
      post: [
        {
          reason: ComAtprotoModerationDefs.REASONMISLEADING,
          title: _(msg`Misleading Post`),
          description: _(msg`Impersonation, misinformation, or false claims`),
        },
        {
          reason: ComAtprotoModerationDefs.REASONSPAM,
          title: _(msg`Spam`),
          description: _(msg`Excessive mentions or replies`),
        },
        {
          reason: ComAtprotoModerationDefs.REASONSEXUAL,
          title: _(msg`Unwanted Sexual Content`),
          description: _(msg`Nudity or adult content not labeled as such`),
        },
        ...common,
      ],
      chatMessage: [
        {
          reason: ComAtprotoModerationDefs.REASONSPAM,
          title: _(msg`Spam`),
          description: _(msg`Excessive or unwanted messages`),
        },
        {
          reason: ComAtprotoModerationDefs.REASONSEXUAL,
          title: _(msg`Unwanted Sexual Content`),
          description: _(msg`Inappropriate messages or explicit links`),
        },
        ...common,
      ],
      list: [
        {
          reason: ComAtprotoModerationDefs.REASONVIOLATION,
          title: _(msg`Name or Description Violates Community Standards`),
          description: _(msg`Terms used violate community standards`),
        },
        ...common,
      ],
      starterPack: [
        {
          reason: ComAtprotoModerationDefs.REASONVIOLATION,
          title: _(msg`Name or Description Violates Community Standards`),
          description: _(msg`Terms used violate community standards`),
        },
        ...common,
      ],
      feed: [
        {
          reason: ComAtprotoModerationDefs.REASONVIOLATION,
          title: _(msg`Name or Description Violates Community Standards`),
          description: _(msg`Terms used violate community standards`),
        },
        ...common,
      ],
    }
  }, [_])
}