File tree Expand file tree Collapse file tree 3 files changed +19
-5
lines changed
Expand file tree Collapse file tree 3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,18 @@ export default class IgcChatComponent extends EventEmitterMixin<
329329 </ div > ` ;
330330 }
331331
332+ private renderSuggestionPrefix ( ) {
333+ const defaultPrefix = html `< igc-icon
334+ name ="star-icon "
335+ collection ="material "
336+ > </ igc-icon > ` ;
337+ return html `< span slot ="start ">
338+ ${ this . _chatState ?. options ?. templates ?. suggestionPrefixTemplate
339+ ? this . _chatState . options . templates . suggestionPrefixTemplate
340+ : defaultPrefix }
341+ </ span > ` ;
342+ }
343+
332344 private renderSuggestions ( ) {
333345 const hasContent = this . _slots . hasAssignedElements ( 'suggestions-header' ) ;
334346 return html `< div part ="suggestions-container ">
@@ -347,11 +359,7 @@ export default class IgcChatComponent extends EventEmitterMixin<
347359 @click =${ ( ) =>
348360 this . _chatState ?. handleSuggestionClick ( suggestion ) }
349361 >
350- < igc-icon
351- slot ="start "
352- name ="star-icon "
353- collection ="material "
354- > </ igc-icon >
362+ ${ this . renderSuggestionPrefix ( ) }
355363 < span slot ="title "> ${ suggestion } </ span >
356364 </ igc-list-item >
357365 </ slot >
Original file line number Diff line number Diff line change @@ -211,6 +211,11 @@ export type IgcChatTemplates = {
211211 * Template for rendering attachments that are currently queued for sending (in the input area).
212212 */
213213 textAreaAttachmentsTemplate ?: AttachmentTemplate ;
214+
215+ /**
216+ * Template for rendering the suggestion prefix.
217+ */
218+ suggestionPrefixTemplate ?: unknown ;
214219} ;
215220
216221export const attachmentIcon =
Original file line number Diff line number Diff line change @@ -477,6 +477,7 @@ export const Chat_Templates: Story = {
477477 templates : {
478478 messageActionsTemplate : _messageActionsTemplate ,
479479 textAreaActionsTemplate : actionsTemplate ,
480+ suggestionPrefixTemplate : html `✨` ,
480481 } ,
481482 } ;
482483 chat . options = { ...options } ;
You can’t perform that action at this time.
0 commit comments