@@ -13,12 +13,15 @@ import IgcMessageAttachmentsComponent from './message-attachments.js';
1313import { styles } from './themes/message.base.css.js' ;
1414import { all } from './themes/message.js' ;
1515import { styles as shared } from './themes/shared/chat-message/chat-message.common.css.js' ;
16+ import '../tooltip/tooltip.js' ;
17+ import { IgcChatResourceStringEN } from '../common/i18n/chat.resources.js' ;
18+ import IgcTooltipComponent from '../tooltip/tooltip.js' ;
1619import {
17- copyIcon ,
20+ thumbDownIcon as badResponseIcon ,
21+ copyIcon as copyResponseIcon ,
22+ thumbUpIcon as goodResponseIcon ,
1823 type IgcMessage ,
19- regenerateIcon ,
20- thumbDownIcon ,
21- thumbUpIcon ,
24+ regenerateIcon as redoIcon ,
2225} from './types.js' ;
2326
2427/**
@@ -55,7 +58,8 @@ export default class IgcChatMessageComponent extends LitElement {
5558 registerComponent (
5659 IgcChatMessageComponent ,
5760 IgcMessageAttachmentsComponent ,
58- IgcAvatarComponent
61+ IgcAvatarComponent ,
62+ IgcTooltipComponent
5963 ) ;
6064 }
6165
@@ -72,6 +76,10 @@ export default class IgcChatMessageComponent extends LitElement {
7276 @property ( { attribute : false } )
7377 public message : IgcMessage | undefined ;
7478
79+ /** The resource strings. */
80+ @property ( { attribute : false } )
81+ public resourceStrings = IgcChatResourceStringEN ;
82+
7583 /**
7684 * Sanitizes message text to prevent XSS or invalid HTML.
7785 * @param text The raw message text
@@ -85,10 +93,10 @@ export default class IgcChatMessageComponent extends LitElement {
8593 constructor ( ) {
8694 super ( ) ;
8795 addThemingController ( this , all ) ;
88- registerIconFromText ( 'copy' , copyIcon , 'material' ) ;
89- registerIconFromText ( 'thumb_up ' , thumbUpIcon , 'material' ) ;
90- registerIconFromText ( 'thumb_down ' , thumbDownIcon , 'material' ) ;
91- registerIconFromText ( 'regenerate ' , regenerateIcon , 'material' ) ;
96+ registerIconFromText ( 'copy-response ' , copyResponseIcon , 'material' ) ;
97+ registerIconFromText ( 'good-response ' , goodResponseIcon , 'material' ) ;
98+ registerIconFromText ( 'bad-response ' , badResponseIcon , 'material' ) ;
99+ registerIconFromText ( 'redo ' , redoIcon , 'material' ) ;
92100 }
93101
94102 private get defaultMessageActionsTemplate ( ) {
@@ -98,29 +106,45 @@ export default class IgcChatMessageComponent extends LitElement {
98106 ( ! isLastMessage || ! this . _chatState ?. options ?. isTyping )
99107 ? html `< div part ="message-actions ">
100108 < igc-icon-button
101- name ="copy "
109+ id ="copy-response-button "
110+ name ="copy-response "
102111 collection ="material "
103112 variant ="flat "
104113 @click =${ this . handleMessageActionClick }
105114 > </ igc-icon-button >
115+ < igc-tooltip anchor ="copy-response-button " hide-delay ="0 ">
116+ ${ this . resourceStrings . reactionCopyResponse }
117+ </ igc-tooltip >
106118 < igc-icon-button
107- name ="thumb_up "
119+ id ="good-response-button "
120+ name ="good-response "
108121 collection ="material "
109122 variant ="flat "
110123 @click =${ this . handleMessageActionClick }
111124 > </ igc-icon-button >
125+ < igc-tooltip anchor ="good-response-button " hide-delay ="0 ">
126+ ${ this . resourceStrings . reactionGoodResponse }
127+ </ igc-tooltip >
112128 < igc-icon-button
113- name ="thumb_down "
129+ id ="bad-response-button "
130+ name ="bad-response "
114131 variant ="flat "
115132 collection ="material "
116133 @click =${ this . handleMessageActionClick }
117134 > </ igc-icon-button >
135+ < igc-tooltip anchor ="bad-response-button " hide-delay ="0 ">
136+ ${ this . resourceStrings . reactionBadResponse }
137+ </ igc-tooltip >
118138 < igc-icon-button
119- name ="regenerate "
139+ id ="redo-button "
140+ name ="redo "
120141 variant ="flat "
121142 collection ="material "
122143 @click =${ this . handleMessageActionClick }
123144 > </ igc-icon-button >
145+ < igc-tooltip anchor ="redo-button " hide-delay ="0 ">
146+ ${ this . resourceStrings . reactionRedo }
147+ </ igc-tooltip >
124148 </ div > `
125149 : nothing ;
126150 }
0 commit comments