added chat 2
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
export type SupportAttachmentType = 'image' | 'audio'
|
||||
export type SupportMessageSender = 'user' | 'admin'
|
||||
export type SupportMessageStatus = 'sending' | 'sent' | 'seen'
|
||||
|
||||
export type SupportMessageReplyTo = {
|
||||
id: string
|
||||
sender?: SupportMessageSender
|
||||
text?: string
|
||||
attachment?: {
|
||||
type: 'image' | 'audio'
|
||||
url: string
|
||||
name?: string
|
||||
} | null
|
||||
}
|
||||
|
||||
export interface SupportAttachment {
|
||||
id: string
|
||||
type: SupportAttachmentType
|
||||
url: string
|
||||
name: string
|
||||
size?: number
|
||||
mimeType?: string
|
||||
durationMs?: number
|
||||
file?: File
|
||||
uploading?: boolean
|
||||
uploadProgress?: number
|
||||
}
|
||||
|
||||
export interface SupportMessage {
|
||||
id: string
|
||||
sender: SupportMessageSender
|
||||
text?: string
|
||||
createdAt: string
|
||||
createdAtRaw?: string | number | Date | null
|
||||
status?: SupportMessageStatus
|
||||
attachments?: SupportAttachment[]
|
||||
replyTo?: SupportMessageReplyTo | null
|
||||
}
|
||||
|
||||
export interface SupportConversation {
|
||||
id: string
|
||||
userName: string
|
||||
avatar: string
|
||||
online: boolean
|
||||
unreadCount: number
|
||||
lastSeenText: string
|
||||
lastMessagePreview: string
|
||||
updatedAtText: string
|
||||
messages: SupportMessage[]
|
||||
}
|
||||
|
||||
export interface ComposerSendPayload {
|
||||
text: string
|
||||
attachments: SupportAttachment[]
|
||||
replyTo?: SupportMessageReplyTo | null
|
||||
}
|
||||
Reference in New Issue
Block a user