initial commit
This commit is contained in:
13
app/utils/message-types.js
Normal file
13
app/utils/message-types.js
Normal file
@@ -0,0 +1,13 @@
|
||||
// The type is the ember-data model name, which is the SIOC class, which is
|
||||
// rdf:type. No field exists whose only job is to say which component to draw.
|
||||
// The assistant's messages are markdown; the user's own stay plain.
|
||||
import InstantMessage from 'frontend-lblod-chat/components/chat/types/instant-message';
|
||||
import AssistantMessage from 'frontend-lblod-chat/components/chat/types/assistant-message';
|
||||
|
||||
const TYPES = {
|
||||
'chat-instant-message': InstantMessage,
|
||||
};
|
||||
|
||||
export function componentFor(modelName, isAssistant) {
|
||||
return isAssistant ? AssistantMessage : (TYPES[modelName] ?? InstantMessage);
|
||||
}
|
||||
Reference in New Issue
Block a user