()
| 161 | }; |
| 162 | |
| 163 | const copyMarkdown = () => { |
| 164 | const formattedRows = formatRows(cols ?? [], rows ?? []); |
| 165 | const markdown = markdownTable([colNames, ...(formattedRows ?? [])], { |
| 166 | // We use stringWidth to account for each character's "visible" size. I.e. emojis have a large visible size than most characters. |
| 167 | stringLength: stringWidth, |
| 168 | }); |
| 169 | // Clipboards can generally accept one of two formats: plaintext and HTML. |
| 170 | // Anything else will result in blank contents (and you having pulled out |
| 171 | // your hair). We can't use navigator.clipboard.writeText because it |
| 172 | // won't work in Safari for http domains. |
| 173 | copyToClipboard(markdown, { format: "text/plain" }); |
| 174 | toast({ description: "Results copied to clipboard" }); |
| 175 | }; |
| 176 | |
| 177 | const { colors } = useTheme<MaterializeTheme>(); |
| 178 | isSubscribeManager = isSubscribeManager ?? false; |
nothing calls this directly
no test coverage detected