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

Function MarkdownCopyButton

packages/session-ui/src/components/markdown.tsx:128–146  ·  view source on GitHub ↗
(props: { labels: Accessor<CopyLabels>; copied: Accessor<boolean> })

Source from the content-addressed store, hash-verified

126}
127
128function MarkdownCopyButton(props: { labels: Accessor<CopyLabels>; copied: Accessor<boolean> }) {
129 const label = () => (props.copied() ? props.labels().copied : props.labels().copy)
130 return (
131 <TooltipV2 placement="top" value={label()}>
132 <IconButtonV2
133 type="button"
134 size="normal"
135 variant="ghost-muted"
136 aria-label={label()}
137 icon={
138 <>
139 <IconV2 name="outline-copy" data-copy-icon />
140 <IconV2 name="check" data-check-icon />
141 </>
142 }
143 />
144 </TooltipV2>
145 )
146}
147
148function setCopyState(host: HTMLElement, labels: CopyLabels, copied: boolean) {
149 const state = copyButtonState.get(host)

Callers

nothing calls this directly

Calls 1

labelFunction · 0.70

Tested by

no test coverage detected