@@ -121,6 +121,7 @@ import { MsEdgeTTS, OUTPUT_FORMAT } from "../utils/ms_edge_tts";
121
121
122
122
import { isEmpty } from "lodash-es" ;
123
123
import { getModelProvider } from "../utils/model" ;
124
+ import clsx from "clsx" ;
124
125
125
126
const localStorage = safeLocalStorage ( ) ;
126
127
@@ -211,7 +212,7 @@ function PromptToast(props: {
211
212
< div className = { styles [ "prompt-toast" ] } key = "prompt-toast" >
212
213
{ props . showToast && context . length > 0 && (
213
214
< div
214
- className = { styles [ "prompt-toast-inner" ] + " clickable"}
215
+ className = { clsx ( styles [ "prompt-toast-inner" ] , " clickable") }
215
216
role = "button"
216
217
onClick = { ( ) => props . setShowModal ( true ) }
217
218
>
@@ -332,10 +333,9 @@ export function PromptHints(props: {
332
333
{ props . prompts . map ( ( prompt , i ) => (
333
334
< div
334
335
ref = { i === selectIndex ? selectedRef : null }
335
- className = {
336
- styles [ "prompt-hint" ] +
337
- ` ${ i === selectIndex ? styles [ "prompt-hint-selected" ] : "" } `
338
- }
336
+ className = { clsx ( styles [ "prompt-hint" ] , {
337
+ [ styles [ "prompt-hint-selected" ] ] : i === selectIndex ,
338
+ } ) }
339
339
key = { prompt . title + i . toString ( ) }
340
340
onClick = { ( ) => props . onPromptSelect ( prompt ) }
341
341
onMouseEnter = { ( ) => setSelectIndex ( i ) }
@@ -395,7 +395,7 @@ export function ChatAction(props: {
395
395
396
396
return (
397
397
< div
398
- className = { ` ${ styles [ "chat-input-action" ] } clickable` }
398
+ className = { clsx ( styles [ "chat-input-action" ] , " clickable" ) }
399
399
onClick = { ( ) => {
400
400
props . onClick ( ) ;
401
401
setTimeout ( updateWidth , 1 ) ;
@@ -1596,9 +1596,12 @@ function _Chat() {
1596
1596
</ div >
1597
1597
) }
1598
1598
1599
- < div className = { ` window-header-title ${ styles [ "chat-body-title" ] } ` } >
1599
+ < div className = { clsx ( " window-header-title" , styles [ "chat-body-title" ] ) } >
1600
1600
< div
1601
- className = { `window-header-main-title ${ styles [ "chat-body-main-title" ] } ` }
1601
+ className = { clsx (
1602
+ "window-header-main-title" ,
1603
+ styles [ "chat-body-main-title" ] ,
1604
+ ) }
1602
1605
onClickCapture = { ( ) => setIsEditingMessage ( true ) }
1603
1606
>
1604
1607
{ ! session . topic ? DEFAULT_TOPIC : session . topic }
@@ -1872,7 +1875,7 @@ function _Chat() {
1872
1875
) }
1873
1876
{ getMessageImages ( message ) . length > 1 && (
1874
1877
< div
1875
- className = { styles [ "chat-message-item-images" ] }
1878
+ className = { clsx ( styles [ "chat-message-item-images" ] ) }
1876
1879
style = {
1877
1880
{
1878
1881
"--image-count" : getMessageImages ( message ) . length ,
@@ -1934,11 +1937,10 @@ function _Chat() {
1934
1937
setUserInput = { setUserInput }
1935
1938
/>
1936
1939
< label
1937
- className = { `${ styles [ "chat-input-panel-inner" ] } ${
1938
- attachImages . length != 0
1939
- ? styles [ "chat-input-panel-inner-attach" ]
1940
- : ""
1941
- } `}
1940
+ className = { clsx ( styles [ "chat-input-panel-inner" ] , {
1941
+ [ styles [ "chat-input-panel-inner-attach" ] ] :
1942
+ attachImages . length !== 0 ,
1943
+ } ) }
1942
1944
htmlFor = "chat-input"
1943
1945
>
1944
1946
< textarea
0 commit comments