@@ -121,6 +121,7 @@ import { MsEdgeTTS, OUTPUT_FORMAT } from "../utils/ms_edge_tts";
121121
122122import { isEmpty } from "lodash-es" ;
123123import { getModelProvider } from "../utils/model" ;
124+ import clsx from "clsx" ;
124125
125126const localStorage = safeLocalStorage ( ) ;
126127
@@ -211,7 +212,7 @@ function PromptToast(props: {
211212 < div className = { styles [ "prompt-toast" ] } key = "prompt-toast" >
212213 { props . showToast && context . length > 0 && (
213214 < div
214- className = { styles [ "prompt-toast-inner" ] + " clickable"}
215+ className = { clsx ( styles [ "prompt-toast-inner" ] , " clickable") }
215216 role = "button"
216217 onClick = { ( ) => props . setShowModal ( true ) }
217218 >
@@ -332,10 +333,9 @@ export function PromptHints(props: {
332333 { props . prompts . map ( ( prompt , i ) => (
333334 < div
334335 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+ } ) }
339339 key = { prompt . title + i . toString ( ) }
340340 onClick = { ( ) => props . onPromptSelect ( prompt ) }
341341 onMouseEnter = { ( ) => setSelectIndex ( i ) }
@@ -395,7 +395,7 @@ export function ChatAction(props: {
395395
396396 return (
397397 < div
398- className = { ` ${ styles [ "chat-input-action" ] } clickable` }
398+ className = { clsx ( styles [ "chat-input-action" ] , " clickable" ) }
399399 onClick = { ( ) => {
400400 props . onClick ( ) ;
401401 setTimeout ( updateWidth , 1 ) ;
@@ -1596,9 +1596,12 @@ function _Chat() {
15961596 </ div >
15971597 ) }
15981598
1599- < div className = { ` window-header-title ${ styles [ "chat-body-title" ] } ` } >
1599+ < div className = { clsx ( " window-header-title" , styles [ "chat-body-title" ] ) } >
16001600 < 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+ ) }
16021605 onClickCapture = { ( ) => setIsEditingMessage ( true ) }
16031606 >
16041607 { ! session . topic ? DEFAULT_TOPIC : session . topic }
@@ -1872,7 +1875,7 @@ function _Chat() {
18721875 ) }
18731876 { getMessageImages ( message ) . length > 1 && (
18741877 < div
1875- className = { styles [ "chat-message-item-images" ] }
1878+ className = { clsx ( styles [ "chat-message-item-images" ] ) }
18761879 style = {
18771880 {
18781881 "--image-count" : getMessageImages ( message ) . length ,
@@ -1934,11 +1937,10 @@ function _Chat() {
19341937 setUserInput = { setUserInput }
19351938 />
19361939 < 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+ } ) }
19421944 htmlFor = "chat-input"
19431945 >
19441946 < textarea
0 commit comments