docs: share tweak copy button

This commit is contained in:
Jay V
2025-07-15 18:25:25 -04:00
parent 7c91f668d1
commit bb155db8b2
5 changed files with 37 additions and 44 deletions

View File

@@ -1,7 +1,6 @@
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
@@ -17,7 +16,6 @@ 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}
@@ -32,7 +30,6 @@ export function ContentText(props: Props) {
{expanded() ? "Show less" : "Show more"}
</button>
)}
<CopyButton text={props.text} />
</div>
)
}