docs: share add copy button to messages in web interface (#902)
Co-authored-by: Jay <air@live.ca>
This commit is contained in:
committed by
GitHub
parent
1af103d29e
commit
7c91f668d1
@@ -1,6 +1,7 @@
|
||||
import style from "./content-text.module.css"
|
||||
import { createSignal } from "solid-js"
|
||||
import { createOverflow } from "./common"
|
||||
import { CopyButton } from "./copy-button"
|
||||
|
||||
interface Props {
|
||||
text: string
|
||||
@@ -16,6 +17,7 @@ export function ContentText(props: Props) {
|
||||
class={style.root}
|
||||
data-expanded={expanded() || props.expand === true ? true : undefined}
|
||||
data-compact={props.compact === true ? true : undefined}
|
||||
style={{ position: "relative" }}
|
||||
>
|
||||
<pre data-slot="text" ref={overflow.ref}>
|
||||
{props.text}
|
||||
@@ -30,6 +32,7 @@ export function ContentText(props: Props) {
|
||||
{expanded() ? "Show less" : "Show more"}
|
||||
</button>
|
||||
)}
|
||||
<CopyButton text={props.text} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user