useXConversationsConversation Management
useXConversations
Conversation Management
type useXConversations = (config: XConversationConfig) => {conversations: ConversationData[];activeConversationKey: string;setActiveConversationKey: (key: string) => boolean;addConversation: (conversation: ConversationData, placement?: 'prepend' | 'append') => boolean;removeConversation: (key: string) => boolean;setConversation: (key: string, conversation: ConversationData) => boolean;getConversation: (key: string) => ConversationData;setConversations: (conversations: ConversationData[]) => boolean;getMessages: (conversationKey: string) => any[];};
interface XConversationConfig {defaultConversations?: ConversationData[];defaultActiveConversationKey?: string;}
interface ConversationData extends AnyObject {key: string;label?: string;}
{
"key": "item1",
"label": "Conversation Item 1",
"disabled": false
}