Merge branch 'main' into hidebutton

This commit is contained in:
mayfwl 2024-08-21 17:13:21 +08:00 committed by GitHub
commit dedfff1ce0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 3 deletions

View File

@ -209,6 +209,7 @@ export function Artifacts() {
const [loading, setLoading] = useState(true);
const [fileName, setFileName] = useState("");
const previewRef = useRef<HTMLPreviewHander>(null);
useEffect(() => {
if (id) {
fetch(`${ApiPath.Artifacts}?id=${id}`)
@ -251,6 +252,7 @@ export function Artifacts() {
{code && (
<HTMLPreview
code={code}
ref={previewRef}
autoHeight={false}
height={"100%"}
ref={previewRef}

View File

@ -8,7 +8,7 @@ import RehypeHighlight from "rehype-highlight";
import { useRef, useState, RefObject, useEffect, useMemo } from "react";
import { copyToClipboard, useWindowSize } from "../utils";
import mermaid from "mermaid";
import Locale from "../locales";
import LoadingIcon from "../icons/three-dots.svg";
import ReloadButtonIcon from "../icons/reload.svg";
import React from "react";
@ -199,7 +199,7 @@ function CustomCode(props: { children: any }) {
<div
className={`show-hide-button ${collapsed ? "collapsed" : "expanded"}`}
>
<button onClick={toggleCollapsed}></button>
<button onClick={toggleCollapsed}>{Locale.NewChat.More}</button>
</div>
)}
</>

View File

@ -304,7 +304,7 @@ pre {
}
}
pre{
pre{
.show-hide-button {
border-radius: 10px;
position: absolute;