(host: HTMLElement, labels: CopyLabels, copied: boolean)
| 146 | } |
| 147 | |
| 148 | function 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 | |
| 159 | function disposeCopyButton(host: HTMLElement) { |
| 160 | copyButtonState.get(host)?.dispose() |
no test coverage detected