added chat 2

This commit is contained in:
2026-07-30 18:30:32 +03:30
parent 99698e345a
commit f4733214ed
26 changed files with 6921 additions and 53 deletions
+56
View File
@@ -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
}