11import { useMutation , useQuery } from '@tanstack/react-query' ;
22import { Button , FormSelect , FormTextarea , Collapsible } from 'components' ;
33import CircularSpinner from 'components/molecules/CircularSpinner/CircularSpinner' ;
4- import { FC , useState } from 'react' ;
4+ import { ComponentPropsWithoutRef , FC , useState } from 'react' ;
55import { useTranslation } from 'react-i18next' ;
66import ReactMarkdown from 'react-markdown' ;
77import remarkGfm from 'remark-gfm' ;
@@ -87,6 +87,17 @@ const TestLLM: FC = () => {
8787 } ) ) ;
8888 } ;
8989
90+ const markdownComponents = {
91+ ol : ( { children} : any ) => (
92+ < ol style = { { paddingLeft : '1.5rem' , listStyleType : 'decimal' } } >
93+ { children }
94+ </ ol >
95+ ) ,
96+ a : ( props : ComponentPropsWithoutRef < "a" > ) => (
97+ < a { ...props } target = "_blank" rel = "noopener noreferrer" />
98+ ) ,
99+ } ;
100+
90101 return (
91102 < div >
92103 { isLoadingConnections ? (
@@ -141,7 +152,7 @@ const TestLLM: FC = () => {
141152 < div className = "result-item" >
142153 < strong > Response:</ strong >
143154 < div className = "response-content" >
144- < ReactMarkdown remarkPlugins = { [ remarkGfm ] } >
155+ < ReactMarkdown remarkPlugins = { [ remarkGfm ] } components = { markdownComponents } >
145156 { inferenceResult . content }
146157 </ ReactMarkdown >
147158 </ div >
@@ -159,7 +170,7 @@ const TestLLM: FC = () => {
159170 < strong > Rank { contextItem . rank } </ strong >
160171 </ div >
161172 < div className = "context-content" >
162- < ReactMarkdown remarkPlugins = { [ remarkGfm ] } >
173+ < ReactMarkdown remarkPlugins = { [ remarkGfm ] } components = { markdownComponents } >
163174 { contextItem . chunkRetrieved }
164175 </ ReactMarkdown >
165176 </ div >
0 commit comments