fix: add fold-code button when code is expand

This commit is contained in:
code-october
2024-09-27 12:08:39 +00:00
parent 870ad913cc
commit 85227596f8
5 changed files with 8 additions and 2 deletions

View File

@@ -196,11 +196,13 @@ function CustomCode(props: { children: any; className?: string }) {
>
{props.children}
</code>
{showToggle && collapsed && (
{showToggle && (
<div
className={`show-hide-button ${collapsed ? "collapsed" : "expanded"}`}
>
<button onClick={toggleCollapsed}>{Locale.NewChat.More}</button>
<button onClick={toggleCollapsed}>
{collapsed ? Locale.NewChat.More : Locale.NewChat.Less}
</button>
</div>
)}
</>