@@ -51,6 +51,11 @@ const ActionButton = styled.div`
51
51
}
52
52
` ;
53
53
54
+ const ActionTip = styled . div `
55
+ font-size: 12px;
56
+ opacity: 0.6;
57
+ ` ;
58
+
54
59
export const AssistantPopover : React . FC < {
55
60
onCompleted : ( ) => void ;
56
61
} > = React . memo ( ( props ) => {
@@ -115,31 +120,6 @@ export const AssistantPopover: React.FC<{
115
120
116
121
< Tip > { Translate . helpMeTo } </ Tip >
117
122
118
- { typeof message === 'string' && message . length > 0 && (
119
- < >
120
- < ActionButton
121
- onClick = { ( ) => handleCallAI ( improveTextPrompt + message ) }
122
- >
123
- { Translate . improveText }
124
- </ ActionButton >
125
- < ActionButton
126
- onClick = { ( ) => handleCallAI ( shorterTextPrompt + message ) }
127
- >
128
- { Translate . makeShorter }
129
- </ ActionButton >
130
- < ActionButton
131
- onClick = { ( ) => handleCallAI ( longerTextPrompt + message ) }
132
- >
133
- { Translate . makeLonger }
134
- </ ActionButton >
135
- < ActionButton
136
- onClick = { ( ) => handleCallAI ( translateTextPrompt + message ) }
137
- >
138
- { Translate . translateInputText }
139
- </ ActionButton >
140
- </ >
141
- ) }
142
-
143
123
< ActionButton
144
124
onClick = { async ( ) => {
145
125
const plainMessages = (
@@ -165,6 +145,33 @@ export const AssistantPopover: React.FC<{
165
145
>
166
146
{ Translate . summaryMessages }
167
147
</ ActionButton >
148
+
149
+ { typeof message === 'string' && message . length > 0 ? (
150
+ < >
151
+ < ActionButton
152
+ onClick = { ( ) => handleCallAI ( improveTextPrompt + message ) }
153
+ >
154
+ { Translate . improveText }
155
+ </ ActionButton >
156
+ < ActionButton
157
+ onClick = { ( ) => handleCallAI ( shorterTextPrompt + message ) }
158
+ >
159
+ { Translate . makeShorter }
160
+ </ ActionButton >
161
+ < ActionButton
162
+ onClick = { ( ) => handleCallAI ( longerTextPrompt + message ) }
163
+ >
164
+ { Translate . makeLonger }
165
+ </ ActionButton >
166
+ < ActionButton
167
+ onClick = { ( ) => handleCallAI ( translateTextPrompt + message ) }
168
+ >
169
+ { Translate . translateInputText }
170
+ </ ActionButton >
171
+ </ >
172
+ ) : (
173
+ < ActionTip > { Translate . inputTextShowMoreActionTip } </ ActionTip >
174
+ ) }
168
175
</ Root >
169
176
) ;
170
177
} ) ;
0 commit comments