@progress/kendo-angular-conversational-ui
Version:
Kendo UI for Angular Conversational UI components
26 lines (25 loc) • 905 B
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { SendMessageEvent } from './api/post-message-event';
const noop = () => { };
const handlers = {
'reply': (action, sender) => {
sender.sendMessage.emit(new SendMessageEvent({
author: sender.user,
text: action.value,
timestamp: new Date()
}));
},
'call': (action) => {
window.open('tel:' + action.value);
},
'openUrl': (action) => {
window.open(action.value);
}
};
/**
* @hidden
*/
export const makeHandler = (action) => handlers[action.type] || noop;