@@ -8,7 +8,6 @@ import { ThumbDislike20Filled, ThumbLike20Filled } from '@fluentui/react-icons'
88import DOMPurify from 'dompurify'
99import remarkGfm from 'remark-gfm'
1010import supersub from 'remark-supersub'
11- import Plot from 'react-plotly.js'
1211import { AskResponse , Citation , Feedback , historyMessageFeedback } from '../../api'
1312import { XSSAllowTags } from '../../constants/xssAllowTags'
1413import { AppStateContext } from '../../state/AppProvider'
@@ -20,10 +19,9 @@ import styles from './Answer.module.css'
2019interface Props {
2120 answer : AskResponse
2221 onCitationClicked : ( citedDocument : Citation ) => void
23- onExectResultClicked : ( ) => void
2422}
2523
26- export const Answer = ( { answer, onCitationClicked, onExectResultClicked } : Props ) => {
24+ export const Answer = ( { answer, onCitationClicked } : Props ) => {
2725 const initializeAnswerFeedback = ( answer : AskResponse ) => {
2826 if ( answer . message_id == undefined ) return undefined
2927 if ( answer . feedback == undefined ) return undefined
@@ -228,7 +226,7 @@ export const Answer = ({ answer, onCitationClicked, onExectResultClicked }: Prop
228226 }
229227
230228 const components = {
231- code ( { node, ...props } : { node : any ; [ key : string ] : any } ) {
229+ code ( { node, ...props } : { node : any ; [ key : string ] : any } ) {
232230 let language
233231 if ( props . className ) {
234232 const match = props . className . match ( / l a n g u a g e - ( \w + ) / )
@@ -269,7 +267,7 @@ export const Answer = ({ answer, onCitationClicked, onExectResultClicked }: Prop
269267 onClick = { ( ) => onLikeResponseClicked ( ) }
270268 style = {
271269 feedbackState === Feedback . Positive ||
272- appStateContext ?. state . feedbackState [ answer . message_id ] === Feedback . Positive
270+ appStateContext ?. state . feedbackState [ answer . message_id ] === Feedback . Positive
273271 ? { color : 'darkgreen' , cursor : 'pointer' }
274272 : { color : 'slategray' , cursor : 'pointer' }
275273 }
@@ -280,8 +278,8 @@ export const Answer = ({ answer, onCitationClicked, onExectResultClicked }: Prop
280278 onClick = { ( ) => onDislikeResponseClicked ( ) }
281279 style = {
282280 feedbackState !== Feedback . Positive &&
283- feedbackState !== Feedback . Neutral &&
284- feedbackState !== undefined
281+ feedbackState !== Feedback . Neutral &&
282+ feedbackState !== undefined
285283 ? { color : 'darkred' , cursor : 'pointer' }
286284 : { color : 'slategray' , cursor : 'pointer' }
287285 }
@@ -291,13 +289,6 @@ export const Answer = ({ answer, onCitationClicked, onExectResultClicked }: Prop
291289 </ Stack . Item >
292290 </ Stack >
293291 </ Stack . Item >
294- { parsedAnswer . plotly_data !== null && (
295- < Stack className = { styles . answerContainer } >
296- < Stack . Item grow >
297- < Plot data = { parsedAnswer . plotly_data . data } layout = { parsedAnswer . plotly_data . layout } />
298- </ Stack . Item >
299- </ Stack >
300- ) }
301292 < Stack horizontal className = { styles . answerFooter } >
302293 { ! ! parsedAnswer . citations . length && (
303294 < Stack . Item onKeyDown = { e => ( e . key === 'Enter' || e . key === ' ' ? toggleIsRefAccordionOpen ( ) : null ) } >
@@ -327,29 +318,6 @@ export const Answer = ({ answer, onCitationClicked, onExectResultClicked }: Prop
327318 < Stack . Item className = { styles . answerDisclaimerContainer } >
328319 < span className = { styles . answerDisclaimer } > AI-generated content may be incorrect</ span >
329320 </ Stack . Item >
330- { ! ! answer . exec_results ?. length && (
331- < Stack . Item onKeyDown = { e => ( e . key === 'Enter' || e . key === ' ' ? toggleIsRefAccordionOpen ( ) : null ) } >
332- < Stack style = { { width : '100%' } } >
333- < Stack horizontal horizontalAlign = "start" verticalAlign = "center" >
334- < Text
335- className = { styles . accordionTitle }
336- onClick = { ( ) => onExectResultClicked ( ) }
337- aria-label = "Open Intents"
338- tabIndex = { 0 }
339- role = "button" >
340- < span >
341- Show Intents
342- </ span >
343- </ Text >
344- < FontIcon
345- className = { styles . accordionIcon }
346- onClick = { handleChevronClick }
347- iconName = { 'ChevronRight' }
348- />
349- </ Stack >
350- </ Stack >
351- </ Stack . Item >
352- ) }
353321 </ Stack >
354322 { chevronIsExpanded && (
355323 < div className = { styles . citationWrapper } >
0 commit comments