@@ -586,42 +586,6 @@ const ChatBox = (
586586 } ,
587587 [ onUpdateVariable ]
588588 ) ;
589- const HumanChatCard = useCallback (
590- ( { item, index } : { item : ChatSiteItemType ; index : number } ) => {
591- return (
592- < >
593- { /* control icon */ }
594- < Flex w = { '100%' } alignItems = { 'center' } justifyContent = { 'flex-end' } >
595- < ChatControllerComponent
596- chat = { item }
597- onDelete = {
598- onDelMessage
599- ? ( ) => {
600- delOneMessage ( { dataId : item . dataId , index } ) ;
601- }
602- : undefined
603- }
604- onRetry = { useCallback ( ( ) => retryInput ( index ) , [ index ] ) }
605- />
606- < ChatAvatar src = { userAvatar } type = { 'Human' } />
607- </ Flex >
608- { /* content */ }
609- < Box mt = { [ '6px' , 2 ] } textAlign = { 'right' } >
610- < Card
611- className = "markdown"
612- { ...MessageCardStyle }
613- bg = { 'primary.200' }
614- borderRadius = { '8px 0 8px 8px' }
615- textAlign = { 'left' }
616- >
617- < Markdown source = { item . value } isChatting = { false } />
618- </ Card >
619- </ Box >
620- </ >
621- ) ;
622- } ,
623- [ ]
624- ) ;
625589
626590 return (
627591 < Flex flexDirection = { 'column' } h = { '100%' } >
@@ -645,7 +609,37 @@ const ChatBox = (
645609 < Box id = { 'history' } >
646610 { chatHistory . map ( ( item , index ) => (
647611 < Box key = { item . dataId } py = { 5 } >
648- { item . obj === 'Human' && < HumanChatCard item = { item } index = { index } /> }
612+ { item . obj === 'Human' && (
613+ < >
614+ { /* control icon */ }
615+ < Flex w = { '100%' } alignItems = { 'center' } justifyContent = { 'flex-end' } >
616+ < ChatControllerComponent
617+ chat = { item }
618+ onDelete = {
619+ onDelMessage
620+ ? ( ) => {
621+ delOneMessage ( { dataId : item . dataId , index } ) ;
622+ }
623+ : undefined
624+ }
625+ onRetry = { ( ) => retryInput ( index ) }
626+ />
627+ < ChatAvatar src = { userAvatar } type = { 'Human' } />
628+ </ Flex >
629+ { /* content */ }
630+ < Box mt = { [ '6px' , 2 ] } textAlign = { 'right' } >
631+ < Card
632+ className = "markdown"
633+ { ...MessageCardStyle }
634+ bg = { 'primary.200' }
635+ borderRadius = { '8px 0 8px 8px' }
636+ textAlign = { 'left' }
637+ >
638+ < Markdown source = { item . value } isChatting = { false } />
639+ </ Card >
640+ </ Box >
641+ </ >
642+ ) }
649643 { item . obj === 'AI' && (
650644 < >
651645 < Flex w = { '100%' } alignItems = { 'center' } >
0 commit comments