MCPcopy Create free account
hub / github.com/anomalyco/opencode / setCopyState

Function setCopyState

packages/session-ui/src/components/markdown.tsx:148–157  ·  view source on GitHub ↗
(host: HTMLElement, labels: CopyLabels, copied: boolean)

Source from the content-addressed store, hash-verified

146}
147
148function setCopyState(host: HTMLElement, labels: CopyLabels, copied: boolean) {
149 const state = copyButtonState.get(host)
150 state?.setLabels(labels)
151 state?.setCopied(copied)
152 if (copied) {
153 host.setAttribute("data-copied", "true")
154 return
155 }
156 host.removeAttribute("data-copied")
157}
158
159function disposeCopyButton(host: HTMLElement) {
160 copyButtonState.get(host)?.dispose()

Callers 3

updateLabelFunction · 0.85
handleClickFunction · 0.85
MarkdownFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected