86ff71596d
- Implemented SupportWidgetDemo component for configuring and mounting the support chat widget. - Introduced Zustand store for managing support chat state, including message handling and socket connection. - Created support host bridge for communication between the widget and parent window. - Added utility functions for JWT token generation and local storage management. - Enhanced user experience with notifications for new messages and chat status updates.
35 lines
817 B
TypeScript
35 lines
817 B
TypeScript
"use client"
|
|
|
|
import {
|
|
SharedMessageEditor,
|
|
type UploadedMessageEditorImage,
|
|
} from "@/components/chat/shared-message-editor"
|
|
|
|
type CustomerMessageEditorProps = {
|
|
disabled?: boolean
|
|
uploadingAsset?: boolean
|
|
onSend: (html: string) => Promise<void>
|
|
onUploadImage: (file: File) => Promise<UploadedMessageEditorImage | null>
|
|
onSendAttachment: (file: File) => Promise<void>
|
|
}
|
|
|
|
export function CustomerMessageEditor({
|
|
disabled = false,
|
|
uploadingAsset = false,
|
|
onSend,
|
|
onUploadImage,
|
|
onSendAttachment,
|
|
}: CustomerMessageEditorProps) {
|
|
return (
|
|
<SharedMessageEditor
|
|
variant="customer"
|
|
disabled={disabled}
|
|
uploadingAsset={uploadingAsset}
|
|
manageLocalUploading
|
|
onSend={onSend}
|
|
onUploadImage={onUploadImage}
|
|
onSendAttachment={onSendAttachment}
|
|
/>
|
|
)
|
|
}
|