@@ -13,6 +13,8 @@ import {
1313 tokens ,
1414} from '@fluentui/react-components'
1515import { useEffect , useState } from 'react'
16+ import ReactMarkdown from 'react-markdown'
17+ import remarkGfm from 'remark-gfm'
1618import {
1719 createWorkbenchAgent ,
1820 deleteWorkbenchAgent ,
@@ -82,6 +84,48 @@ const useStyles = makeStyles({
8284 backgroundColor : tokens . colorNeutralBackground1 ,
8385 color : tokens . colorNeutralForeground1 ,
8486 } ,
87+ runOutputMarkdown : {
88+ border : `1px solid ${ tokens . colorNeutralStroke1 } ` ,
89+ borderRadius : tokens . borderRadiusMedium ,
90+ padding : `${ tokens . spacingVerticalS } ${ tokens . spacingHorizontalM } ` ,
91+ backgroundColor : tokens . colorNeutralBackground1 ,
92+ maxHeight : '320px' ,
93+ overflowY : 'auto' ,
94+ '& h1, & h2, & h3' : {
95+ margin : `${ tokens . spacingVerticalXS } 0` ,
96+ fontWeight : tokens . fontWeightSemibold ,
97+ } ,
98+ '& ul, & ol' : {
99+ margin : `${ tokens . spacingVerticalXS } 0` ,
100+ paddingLeft : tokens . spacingHorizontalL ,
101+ } ,
102+ '& table' : {
103+ width : '100%' ,
104+ borderCollapse : 'collapse' ,
105+ marginTop : tokens . spacingVerticalXS ,
106+ } ,
107+ '& th, & td' : {
108+ border : `1px solid ${ tokens . colorNeutralStroke1 } ` ,
109+ padding : tokens . spacingHorizontalXS ,
110+ textAlign : 'left' ,
111+ } ,
112+ '& pre' : {
113+ backgroundColor : tokens . colorNeutralBackground3 ,
114+ padding : tokens . spacingHorizontalM ,
115+ borderRadius : tokens . borderRadiusSmall ,
116+ overflowX : 'auto' ,
117+ } ,
118+ '& code' : {
119+ fontFamily : 'monospace' ,
120+ backgroundColor : tokens . colorNeutralBackground3 ,
121+ padding : '0 4px' ,
122+ borderRadius : tokens . borderRadiusSmall ,
123+ } ,
124+ '& a' : {
125+ color : tokens . colorBrandForegroundLink ,
126+ textDecoration : 'underline' ,
127+ } ,
128+ } ,
85129} )
86130
87131export default function WorkbenchPage ( ) {
@@ -543,14 +587,12 @@ export default function WorkbenchPage() {
543587
544588 { runError && < Text data-testid = "workbench-run-error" > { runError } </ Text > }
545589 { runOutput && (
546- < Field label = "Run output" >
547- < Textarea
548- data-testid = "workbench-run-output"
549- value = { runOutput }
550- readOnly
551- resize = "vertical"
552- rows = { 6 }
553- />
590+ < Field label = "Run output (Markdown)" >
591+ < div data-testid = "workbench-run-output" className = { styles . runOutputMarkdown } >
592+ < ReactMarkdown remarkPlugins = { [ remarkGfm ] } >
593+ { runOutput }
594+ </ ReactMarkdown >
595+ </ div >
554596 </ Field >
555597 ) }
556598 </ div >
0 commit comments