Something went wrong. Try again.
Bluesky app fork with some witchin' additions 💫 forked from jollywhoppers.com/witchsky.app
Something went wrong. Try again.
7.9 kB · 256 lines
TypeScript
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257import {useMemo} from 'react'import {ToolsOzoneReportDefs as OzoneReportDefs} from '@atproto/api'import {msg} from '@lingui/macro'import {useLingui} from '@lingui/react'
export type ReportCategory = | 'childSafety' | 'violencePhysicalHarm' | 'sexualAdultContent' | 'harassmentHate' | 'misleading' | 'ruleBreaking' | 'selfHarm' | 'other'
export type ReportCategoryConfig = { key: ReportCategory title: string description: string options: ReportOption[]}
export type ReportOption = { title: string reason: OzoneReportDefs.ReasonType}
export function useReportOptions() { const {_} = useLingui()
return useMemo(() => { const categories: Record<ReportCategory, ReportCategoryConfig> = { misleading: { key: 'misleading', title: _(msg`Misleading`), description: _(msg`Spam or other inauthentic behavior or deception`), options: [ { title: _(msg`Spam`), reason: OzoneReportDefs.REASONMISLEADINGSPAM, }, { title: _(msg`Scam`), reason: OzoneReportDefs.REASONMISLEADINGSCAM, }, { title: _(msg`Fake account or bot`), reason: OzoneReportDefs.REASONMISLEADINGBOT, }, { title: _(msg`Impersonation`), reason: OzoneReportDefs.REASONMISLEADINGIMPERSONATION, }, { title: _(msg`False information about elections`), reason: OzoneReportDefs.REASONMISLEADINGELECTIONS, }, { title: _(msg`Other misleading content`), reason: OzoneReportDefs.REASONMISLEADINGOTHER, }, ], }, sexualAdultContent: { key: 'sexualAdultContent', title: _(msg`Adult content`), description: _( msg`Unlabeled, abusive, or non-consensual adult content`, ), options: [ { title: _(msg`Unlabeled adult content`), reason: OzoneReportDefs.REASONSEXUALUNLABELED, }, { title: _(msg`Adult sexual abuse content`), reason: OzoneReportDefs.REASONSEXUALABUSECONTENT, }, { title: _(msg`Non-consensual intimate imagery`), reason: OzoneReportDefs.REASONSEXUALNCII, }, { title: _(msg`Deepfake adult content`), reason: OzoneReportDefs.REASONSEXUALDEEPFAKE, }, { title: _(msg`Animal sexual abuse`), reason: OzoneReportDefs.REASONSEXUALANIMAL, }, { title: _(msg`Other sexual violence content`), reason: OzoneReportDefs.REASONSEXUALOTHER, }, ], }, harassmentHate: { key: 'harassmentHate', title: _(msg`Harassment or hate`), description: _(msg`Abusive or discriminatory behavior`), options: [ { title: _(msg`Trolling`), reason: OzoneReportDefs.REASONHARASSMENTTROLL, }, { title: _(msg`Targeted harassment`), reason: OzoneReportDefs.REASONHARASSMENTTARGETED, }, { title: _(msg`Hate speech`), reason: OzoneReportDefs.REASONHARASSMENTHATESPEECH, }, { title: _(msg`Doxxing`), reason: OzoneReportDefs.REASONHARASSMENTDOXXING, }, { title: _(msg`Other harassing or hateful content`), reason: OzoneReportDefs.REASONHARASSMENTOTHER, }, ], }, violencePhysicalHarm: { key: 'violencePhysicalHarm', title: _(msg`Violence`), description: _(msg`Violent or threatening content`), options: [ { title: _(msg`Animal welfare`), reason: OzoneReportDefs.REASONVIOLENCEANIMAL, }, { title: _(msg`Threats or incitement`), reason: OzoneReportDefs.REASONVIOLENCETHREATS, }, { title: _(msg`Graphic violent content`), reason: OzoneReportDefs.REASONVIOLENCEGRAPHICCONTENT, }, { title: _(msg`Glorification of violence`), reason: OzoneReportDefs.REASONVIOLENCEGLORIFICATION, }, { title: _(msg`Extremist content`), reason: OzoneReportDefs.REASONVIOLENCEEXTREMISTCONTENT, }, { title: _(msg`Human trafficking`), reason: OzoneReportDefs.REASONVIOLENCETRAFFICKING, }, { title: _(msg`Other violent content`), reason: OzoneReportDefs.REASONVIOLENCEOTHER, }, ], }, childSafety: { key: 'childSafety', title: _(msg`Child safety`), description: _(msg`Harming or endangering minors`), options: [ { title: _(msg`Child Sexual Abuse Material (CSAM)`), reason: OzoneReportDefs.REASONCHILDSAFETYCSAM, }, { title: _(msg`Grooming or predatory behavior`), reason: OzoneReportDefs.REASONCHILDSAFETYGROOM, }, { title: _(msg`Privacy violation of a minor`), reason: OzoneReportDefs.REASONCHILDSAFETYPRIVACY, }, { title: _(msg`Minor harassment or bullying`), reason: OzoneReportDefs.REASONCHILDSAFETYHARASSMENT, }, { title: _(msg`Other child safety issue`), reason: OzoneReportDefs.REASONCHILDSAFETYOTHER, }, ], }, selfHarm: { key: 'selfHarm', title: _(msg`Self-harm or dangerous behaviors`), description: _(msg`Harmful or high-risk activities`), options: [ { title: _(msg`Content promoting or depicting self-harm`), reason: OzoneReportDefs.REASONSELFHARMCONTENT, }, { title: _(msg`Eating disorders`), reason: OzoneReportDefs.REASONSELFHARMED, }, { title: _(msg`Dangerous challenges or activities`), reason: OzoneReportDefs.REASONSELFHARMSTUNTS, }, { title: _(msg`Dangerous substances or drug abuse`), reason: OzoneReportDefs.REASONSELFHARMSUBSTANCES, }, { title: _(msg`Other dangerous content`), reason: OzoneReportDefs.REASONSELFHARMOTHER, }, ], }, ruleBreaking: { key: 'ruleBreaking', title: _(msg`Breaking site rules`), description: _(msg`Banned activities or security violations`), options: [ { title: _(msg`Hacking or system attacks`), reason: OzoneReportDefs.REASONRULESITESECURITY, }, { title: _(msg`Promoting or selling prohibited items or services`), reason: OzoneReportDefs.REASONRULEPROHIBITEDSALES, }, { title: _(msg`Banned user returning`), reason: OzoneReportDefs.REASONRULEBANEVASION, }, { title: _(msg`Other network rule-breaking`), reason: OzoneReportDefs.REASONRULEOTHER, }, ], }, other: { key: 'other', title: _(msg`Other`), description: _(msg`An issue not included in these options`), options: [ { title: _(msg`Other`), reason: OzoneReportDefs.REASONOTHER, }, ], }, }
return { categories: Object.values(categories) as ReportCategoryConfig[], getCategory(reasonName: ReportCategory) { return categories[reasonName] }, } }, [_])}