added chat 2

This commit is contained in:
2026-07-30 18:33:08 +03:30
parent 106b0ebbdf
commit 5b0bb45e52
21 changed files with 5243 additions and 25 deletions
+3
View File
@@ -48,6 +48,9 @@ export interface User {
virtual_card_number: string
finger_print: boolean
gold: number;
chat_room_id?: string | null
chat_user_id?: string | null
settings?: Array<{ key?: string; value?: string | number }>
}
export interface Login {
+77
View File
@@ -0,0 +1,77 @@
export type ChatAttachmentType = 'image' | 'audio'
export type ChatMessageSender = 'user' | 'support' | 'admin'
export type ChatMessageStatus = 'sending' | 'sent' | 'seen' | 'failed'
export type ChatAttachment = {
id: string
type: 'image' | 'audio'
url: string
name?: string
size?: number
mimeType?: string
durationMs?: number
file?: File
uploading?: boolean
uploadProgress?: number
}
export type ChatReplyPreview = {
id: string
sender: string
text?: string
attachment?: {
type: 'image' | 'audio'
url: string
name?: string
} | null
}
export interface ChatMessage {
id: string
text?: string
sender: 'user' | 'support'
createdAt: string
createdAtRaw?: string | number | Date | null
status?: 'sending' | 'sent' | 'seen'
attachments?: ChatAttachment[]
// reply
reply?: string | null
replyTo?: ChatReplyPreview | null
}
export type ComposerSendPayload = {
text: string
attachments: ChatAttachment[]
reply?: string | null
replyTo?: ChatReplyPreview | null
}
export interface SupportMessage {
id: string
sender: 'user' | 'admin'
text?: string
createdAt: string
createdAtRaw?: string | number | Date | null
status?: ChatMessageStatus
attachments?: ChatAttachment[]
// reply
reply?: string | null
replyTo?: ChatReplyPreview | null
}
export interface SupportConversation {
id: string
userName: string
avatar: string
online: boolean
unreadCount: number
lastSeenText: string
lastMessagePreview: string
updatedAtText: string
messages: SupportMessage[]
}