feat: stream流响应

This commit is contained in:
Archer
2023-03-10 02:57:13 +08:00
parent 26888e855b
commit 65da4653bc
7 changed files with 73 additions and 88 deletions

View File

@@ -369,7 +369,7 @@
}
pre code {
background-color: #222;
background-color: #222 !important;
color: #fff;
width: 100%;
font-family: 'Söhne,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Helvetica Neue,Arial,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji';

View File

@@ -26,8 +26,8 @@ const Markdown = ({ source, isChatting }: { source: string; isChatting: boolean
code({ node, inline, className, children, ...props }) {
const match = /language-(\w+)/.exec(className || '');
const code = String(children).replace(/\n$/, '');
return !inline ? (
<Box my={3} borderRadius={'md'} overflow={'hidden'}>
return !inline || match ? (
<Box my={3} borderRadius={'md'} overflow={'hidden'} backgroundColor={'#222'}>
<Flex
py={2}
px={5}