3
3
* License: MS-RSL – see LICENSE.md for details
4
4
*/
5
5
6
+ // cSpell:ignore blankcolumn
7
+
6
8
import { Badge , Button , Col , Popconfirm , Row , Space , Tooltip } from "antd" ;
7
9
import { List , Map } from "immutable" ;
8
10
import { CSSProperties , useEffect , useLayoutEffect } from "react" ;
9
11
import { useIntl } from "react-intl" ;
12
+
10
13
import { Avatar } from "@cocalc/frontend/account/avatar/avatar" ;
11
14
import {
12
15
CSS ,
@@ -55,14 +58,14 @@ const BORDER = "2px solid #ccc";
55
58
56
59
const SHOW_EDIT_BUTTON_MS = 15000 ;
57
60
58
- const TRHEAD_STYLE_SINGLE : CSS = {
61
+ const THREAD_STYLE_SINGLE : CSS = {
59
62
marginLeft : "15px" ,
60
63
marginRight : "15px" ,
61
64
paddingLeft : "15px" ,
62
65
} as const ;
63
66
64
67
const THREAD_STYLE : CSS = {
65
- ...TRHEAD_STYLE_SINGLE ,
68
+ ...THREAD_STYLE_SINGLE ,
66
69
borderLeft : BORDER ,
67
70
borderRight : BORDER ,
68
71
} as const ;
@@ -102,7 +105,7 @@ interface Props {
102
105
user_map ?: Map < string , any > ;
103
106
project_id ?: string ; // improves relative links if given
104
107
path ?: string ;
105
- font_size : number ;
108
+ font_size ? : number ;
106
109
is_prev_sender ?: boolean ;
107
110
show_avatar ?: boolean ;
108
111
mode : Mode ;
@@ -395,7 +398,7 @@ export default function Message({
395
398
marginTop = "5px" ;
396
399
}
397
400
398
- const message_style : CSSProperties = {
401
+ const messageStyle : CSSProperties = {
399
402
color,
400
403
background,
401
404
wordWrap : "break-word" ,
@@ -418,7 +421,7 @@ export default function Message({
418
421
const showEditButton = Date . now ( ) - date < SHOW_EDIT_BUTTON_MS ;
419
422
const feedback = message . getIn ( [ "feedback" , account_id ] ) ;
420
423
const otherFeedback =
421
- isLLMThread && msgWrittenByLLM ? 0 : ( message . get ( "feedback" ) ?. size ?? 0 ) ;
424
+ isLLMThread && msgWrittenByLLM ? 0 : message . get ( "feedback" ) ?. size ?? 0 ;
422
425
const showOtherFeedback = otherFeedback > 0 ;
423
426
424
427
const editControlRow = ( ) => {
@@ -563,7 +566,7 @@ export default function Message({
563
566
) : undefined }
564
567
</ div >
565
568
< div
566
- style = { message_style }
569
+ style = { messageStyle }
567
570
className = "smc-chat-message"
568
571
onDoubleClick = { edit_message }
569
572
>
@@ -844,7 +847,7 @@ export default function Message({
844
847
return THREAD_STYLE_TOP ;
845
848
}
846
849
} else {
847
- return TRHEAD_STYLE_SINGLE ;
850
+ return THREAD_STYLE_SINGLE ;
848
851
}
849
852
} else if ( allowReply ) {
850
853
return THREAD_STYLE_BOTTOM ;
@@ -945,7 +948,7 @@ export default function Message({
945
948
) ;
946
949
}
947
950
948
- function getThreadfoldOrBlank ( ) {
951
+ function getThreadFoldOrBlank ( ) {
949
952
const xs = 2 ;
950
953
if ( is_thread_body || ( ! is_thread_body && ! is_thread ) ) {
951
954
return BLANK_COLUMN ( xs ) ;
@@ -964,7 +967,7 @@ export default function Message({
964
967
width : "100%" ,
965
968
textAlign : "center" ,
966
969
} ;
967
- const iconname = is_folded
970
+ const iconName = is_folded
968
971
? mode === "standalone"
969
972
? reverseRowOrdering
970
973
? "right-circle-o"
@@ -978,7 +981,7 @@ export default function Message({
978
981
onClick = { ( ) => actions ?. toggleFoldThread ( message . get ( "date" ) , index ) }
979
982
icon = {
980
983
< Icon
981
- name = { iconname }
984
+ name = { iconName }
982
985
style = { { fontSize : mode === "standalone" ? "22px" : "18px" } }
983
986
/>
984
987
}
@@ -1027,14 +1030,14 @@ export default function Message({
1027
1030
1028
1031
switch ( mode ) {
1029
1032
case "standalone" :
1030
- const cols = [ avatar_column ( ) , contentColumn ( ) , getThreadfoldOrBlank ( ) ] ;
1033
+ const cols = [ avatar_column ( ) , contentColumn ( ) , getThreadFoldOrBlank ( ) ] ;
1031
1034
if ( reverseRowOrdering ) {
1032
1035
cols . reverse ( ) ;
1033
1036
}
1034
1037
return cols ;
1035
1038
1036
1039
case "sidechat" :
1037
- return [ getThreadfoldOrBlank ( ) , contentColumn ( ) ] ;
1040
+ return [ getThreadFoldOrBlank ( ) , contentColumn ( ) ] ;
1038
1041
1039
1042
default :
1040
1043
unreachable ( mode ) ;
0 commit comments