about summary refs log tree commit diff
path: root/src/lib/moderation/useGlobalLabelStrings.ts
blob: 86ad8e76d68835f15f610e0a829b9596e75ae25b (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
import {useMemo} from 'react'
import {msg} from '@lingui/macro'
import {useLingui} from '@lingui/react'

export type GlobalLabelStrings = Record<
  string,
  {
    name: string
    description: string
  }
>

export function useGlobalLabelStrings(): GlobalLabelStrings {
  const {_} = useLingui()
  return useMemo(
    () => ({
      '!hide': {
        name: _(msg`Content Blocked`),
        description: _(msg`This content has been hidden by the moderators.`),
      },
      '!warn': {
        name: _(msg`Content Warning`),
        description: _(
          msg`This content has received a general warning from moderators.`,
        ),
      },
      '!no-unauthenticated': {
        name: _(msg`Sign-in Required`),
        description: _(
          msg`This user has requested that their content only be shown to signed-in users.`,
        ),
      },
      porn: {
        name: _(msg`Adult Content`),
        description: _(msg`Explicit sexual images.`),
      },
      sexual: {
        name: _(msg`Sexually Suggestive`),
        description: _(msg`Does not include nudity.`),
      },
      nudity: {
        name: _(msg`Non-sexual Nudity`),
        description: _(msg`E.g. artistic nudes.`),
      },
      'graphic-media': {
        name: _(msg`Graphic Media`),
        description: _(msg`Explicit or potentially disturbing media.`),
      },
      gore: {
        name: _(msg`Graphic Media`),
        description: _(msg`Explicit or potentially disturbing media.`),
      },
    }),
    [_],
  )
}