Bluesky app fork with some witchin' additions 馃挮
at jean/pds-label 256 lines 7.8 kB view raw
1import {useMemo} from 'react' 2import {ToolsOzoneReportDefs as OzoneReportDefs} from '@atproto/api' 3import {msg} from '@lingui/core/macro' 4import {useLingui} from '@lingui/react' 5 6export type ReportCategory = 7 | 'childSafety' 8 | 'violencePhysicalHarm' 9 | 'sexualAdultContent' 10 | 'harassmentHate' 11 | 'misleading' 12 | 'ruleBreaking' 13 | 'selfHarm' 14 | 'other' 15 16export type ReportCategoryConfig = { 17 key: ReportCategory 18 title: string 19 description: string 20 options: ReportOption[] 21} 22 23export type ReportOption = { 24 title: string 25 reason: OzoneReportDefs.ReasonType 26} 27 28export function useReportOptions() { 29 const {_} = useLingui() 30 31 return useMemo(() => { 32 const categories: Record<ReportCategory, ReportCategoryConfig> = { 33 misleading: { 34 key: 'misleading', 35 title: _(msg`Misleading`), 36 description: _(msg`Spam or other inauthentic behavior or deception`), 37 options: [ 38 { 39 title: _(msg`Spam`), 40 reason: OzoneReportDefs.REASONMISLEADINGSPAM, 41 }, 42 { 43 title: _(msg`Scam`), 44 reason: OzoneReportDefs.REASONMISLEADINGSCAM, 45 }, 46 { 47 title: _(msg`Fake account or bot`), 48 reason: OzoneReportDefs.REASONMISLEADINGBOT, 49 }, 50 { 51 title: _(msg`Impersonation`), 52 reason: OzoneReportDefs.REASONMISLEADINGIMPERSONATION, 53 }, 54 { 55 title: _(msg`False information about elections`), 56 reason: OzoneReportDefs.REASONMISLEADINGELECTIONS, 57 }, 58 { 59 title: _(msg`Other misleading content`), 60 reason: OzoneReportDefs.REASONMISLEADINGOTHER, 61 }, 62 ], 63 }, 64 sexualAdultContent: { 65 key: 'sexualAdultContent', 66 title: _(msg`Adult content`), 67 description: _( 68 msg`Unlabeled, abusive, or non-consensual adult content`, 69 ), 70 options: [ 71 { 72 title: _(msg`Unlabeled adult content`), 73 reason: OzoneReportDefs.REASONSEXUALUNLABELED, 74 }, 75 { 76 title: _(msg`Adult sexual abuse content`), 77 reason: OzoneReportDefs.REASONSEXUALABUSECONTENT, 78 }, 79 { 80 title: _(msg`Non-consensual intimate imagery`), 81 reason: OzoneReportDefs.REASONSEXUALNCII, 82 }, 83 { 84 title: _(msg`Deepfake adult content`), 85 reason: OzoneReportDefs.REASONSEXUALDEEPFAKE, 86 }, 87 { 88 title: _(msg`Animal sexual abuse`), 89 reason: OzoneReportDefs.REASONSEXUALANIMAL, 90 }, 91 { 92 title: _(msg`Other sexual violence content`), 93 reason: OzoneReportDefs.REASONSEXUALOTHER, 94 }, 95 ], 96 }, 97 harassmentHate: { 98 key: 'harassmentHate', 99 title: _(msg`Harassment or hate`), 100 description: _(msg`Abusive or discriminatory behavior`), 101 options: [ 102 { 103 title: _(msg`Trolling`), 104 reason: OzoneReportDefs.REASONHARASSMENTTROLL, 105 }, 106 { 107 title: _(msg`Targeted harassment`), 108 reason: OzoneReportDefs.REASONHARASSMENTTARGETED, 109 }, 110 { 111 title: _(msg`Hate speech`), 112 reason: OzoneReportDefs.REASONHARASSMENTHATESPEECH, 113 }, 114 { 115 title: _(msg`Doxxing`), 116 reason: OzoneReportDefs.REASONHARASSMENTDOXXING, 117 }, 118 { 119 title: _(msg`Other harassing or hateful content`), 120 reason: OzoneReportDefs.REASONHARASSMENTOTHER, 121 }, 122 ], 123 }, 124 violencePhysicalHarm: { 125 key: 'violencePhysicalHarm', 126 title: _(msg`Violence`), 127 description: _(msg`Violent or threatening content`), 128 options: [ 129 { 130 title: _(msg`Animal welfare`), 131 reason: OzoneReportDefs.REASONVIOLENCEANIMAL, 132 }, 133 { 134 title: _(msg`Threats or incitement`), 135 reason: OzoneReportDefs.REASONVIOLENCETHREATS, 136 }, 137 { 138 title: _(msg`Graphic violent content`), 139 reason: OzoneReportDefs.REASONVIOLENCEGRAPHICCONTENT, 140 }, 141 { 142 title: _(msg`Glorification of violence`), 143 reason: OzoneReportDefs.REASONVIOLENCEGLORIFICATION, 144 }, 145 { 146 title: _(msg`Extremist content`), 147 reason: OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT, 148 }, 149 { 150 title: _(msg`Human trafficking`), 151 reason: OzoneReportDefs.REASONVIOLENCETRAFFICKING, 152 }, 153 { 154 title: _(msg`Other violent content`), 155 reason: OzoneReportDefs.REASONVIOLENCEOTHER, 156 }, 157 ], 158 }, 159 childSafety: { 160 key: 'childSafety', 161 title: _(msg`Child safety`), 162 description: _(msg`Harming or endangering minors`), 163 options: [ 164 { 165 title: _(msg`Child Sexual Abuse Material (CSAM)`), 166 reason: OzoneReportDefs.REASONCHILDSAFETYCSAM, 167 }, 168 { 169 title: _(msg`Grooming or predatory behavior`), 170 reason: OzoneReportDefs.REASONCHILDSAFETYGROOM, 171 }, 172 { 173 title: _(msg`Privacy violation of a minor`), 174 reason: OzoneReportDefs.REASONCHILDSAFETYPRIVACY, 175 }, 176 { 177 title: _(msg`Minor harassment or bullying`), 178 reason: OzoneReportDefs.REASONCHILDSAFETYHARASSMENT, 179 }, 180 { 181 title: _(msg`Other child safety issue`), 182 reason: OzoneReportDefs.REASONCHILDSAFETYOTHER, 183 }, 184 ], 185 }, 186 selfHarm: { 187 key: 'selfHarm', 188 title: _(msg`Self-harm or dangerous behaviors`), 189 description: _(msg`Harmful or high-risk activities`), 190 options: [ 191 { 192 title: _(msg`Content promoting or depicting self-harm`), 193 reason: OzoneReportDefs.REASONSELFHARMCONTENT, 194 }, 195 { 196 title: _(msg`Eating disorders`), 197 reason: OzoneReportDefs.REASONSELFHARMED, 198 }, 199 { 200 title: _(msg`Dangerous challenges or activities`), 201 reason: OzoneReportDefs.REASONSELFHARMSTUNTS, 202 }, 203 { 204 title: _(msg`Dangerous substances or drug abuse`), 205 reason: OzoneReportDefs.REASONSELFHARMSUBSTANCES, 206 }, 207 { 208 title: _(msg`Other dangerous content`), 209 reason: OzoneReportDefs.REASONSELFHARMOTHER, 210 }, 211 ], 212 }, 213 ruleBreaking: { 214 key: 'ruleBreaking', 215 title: _(msg`Breaking site rules`), 216 description: _(msg`Banned activities or security violations`), 217 options: [ 218 { 219 title: _(msg`Hacking or system attacks`), 220 reason: OzoneReportDefs.REASONRULESITESECURITY, 221 }, 222 { 223 title: _(msg`Promoting or selling prohibited items or services`), 224 reason: OzoneReportDefs.REASONRULEPROHIBITEDSALES, 225 }, 226 { 227 title: _(msg`Banned user returning`), 228 reason: OzoneReportDefs.REASONRULEBANEVASION, 229 }, 230 { 231 title: _(msg`Other network rule-breaking`), 232 reason: OzoneReportDefs.REASONRULEOTHER, 233 }, 234 ], 235 }, 236 other: { 237 key: 'other', 238 title: _(msg`Other`), 239 description: _(msg`An issue not included in these options`), 240 options: [ 241 { 242 title: _(msg`Other`), 243 reason: OzoneReportDefs.REASONOTHER, 244 }, 245 ], 246 }, 247 } 248 249 return { 250 categories: Object.values(categories), 251 getCategory(reasonName: ReportCategory) { 252 return categories[reasonName] 253 }, 254 } 255 }, [_]) 256}