From d0ab9c7ec4d85be054b8504fabce819c750a0119 Mon Sep 17 00:00:00 2001 From: josc146 Date: Mon, 25 Mar 2024 16:08:29 +0800 Subject: [PATCH] add system role support for preset --- frontend/src/components/MarkdownRender.tsx | 4 +- frontend/src/pages/Chat.tsx | 45 ++++++++++++++----- .../pages/PresetsManager/MessagesEditor.tsx | 2 +- frontend/src/types/chat.ts | 3 +- frontend/src/utils/index.tsx | 8 ++-- 5 files changed, 44 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/MarkdownRender.tsx b/frontend/src/components/MarkdownRender.tsx index 27977a7..6a81136 100644 --- a/frontend/src/components/MarkdownRender.tsx +++ b/frontend/src/components/MarkdownRender.tsx @@ -28,10 +28,10 @@ const MarkdownRender: FC = (props return (
{props.disabled ? -
+
{props.children}
: - ; }); +const HiddenAvatar: FC = ({ children, hidden, ...props }) => { + if (hidden) { + return
{children}
; + } else { + return ( + + {children} + + ); + } +}; + const ChatMessageItem: FC<{ uuid: string, onSubmit: (message: string | null, answerId: string | null, @@ -129,7 +142,9 @@ const ChatMessageItem: FC<{ return
{ const utils = document.getElementById('utils-' + uuid); @@ -140,22 +155,26 @@ const ChatMessageItem: FC<{ if (utils) utils.classList.add('invisible'); }} > -