// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import memoizeOne from 'memoize-one';
import { useAdapter } from '../adapter/ChatAdapterProvider';
/**
 * @private
 */
export const useHandlers = (_component) => {
    return createCompositeHandlers(useAdapter());
};
const createCompositeHandlers = memoizeOne((adapter) => ({
    // have to use `any` here so we don't import from Chat SDK
    // eslint-disable-next-line @typescript-eslint/no-explicit-any
    onSendMessage: (content, options) => {
        return adapter.sendMessage(content, options);
    },
    onLoadPreviousChatMessages: adapter.loadPreviousChatMessages,
    onMessageSeen: adapter.sendReadReceipt,
    onTyping: adapter.sendTypingIndicator,
    onRemoveParticipant: adapter.removeParticipant,
    updateThreadTopicName: adapter.setTopic,
    onUpdateMessage: function (messageId, content) {
        return adapter.updateMessage(messageId, content);
    },
    onDeleteMessage: adapter.deleteMessage
}));
//# sourceMappingURL=useHandlers.js.map