about summary refs log tree commit diff
path: root/src/components/moderation/ReportDialog/types.ts
blob: e84369905c03bc17c52aac0f6b5d27d0a21d0c58 (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
import {
  type $Typed,
  type AppBskyActorDefs,
  type AppBskyFeedDefs,
  type AppBskyGraphDefs,
  type ChatBskyConvoDefs,
} from '@atproto/api'

import type * as Dialog from '#/components/Dialog'

export type ReportSubject =
  | $Typed<AppBskyActorDefs.ProfileViewBasic>
  | $Typed<AppBskyActorDefs.ProfileView>
  | $Typed<AppBskyActorDefs.ProfileViewDetailed>
  | $Typed<AppBskyGraphDefs.ListView>
  | $Typed<AppBskyFeedDefs.GeneratorView>
  | $Typed<AppBskyGraphDefs.StarterPackView>
  | $Typed<AppBskyFeedDefs.PostView>
  | {convoId: string; message: ChatBskyConvoDefs.MessageView}

export type ParsedReportSubject =
  | {
      type: 'post'
      uri: string
      cid: string
      nsid: string
      attributes: {
        reply: boolean
        image: boolean
        video: boolean
        link: boolean
        quote: boolean
      }
    }
  | {
      type: 'list'
      uri: string
      cid: string
      nsid: string
    }
  | {
      type: 'feed'
      uri: string
      cid: string
      nsid: string
    }
  | {
      type: 'starterPack'
      uri: string
      cid: string
      nsid: string
    }
  | {
      type: 'account'
      did: string
      nsid: string
    }
  | {
      type: 'chatMessage'
      convoId: string
      message: ChatBskyConvoDefs.MessageView
    }

export type ReportDialogProps = {
  control: Dialog.DialogOuterProps['control']
  subject: ParsedReportSubject
}