()
| 183 | const clipboard = useClipboard() |
| 184 | |
| 185 | function copySelection() { |
| 186 | const text = renderer.getSelection()?.getSelectedText() |
| 187 | if (!text || !clipboard.write) return false |
| 188 | void clipboard.write(text).then( |
| 189 | () => toast.show({ message: "Copied to clipboard", variant: "info" }), |
| 190 | (error) => toast.error(error), |
| 191 | ) |
| 192 | renderer.clearSelection() |
| 193 | return true |
| 194 | } |
| 195 | |
| 196 | return ( |
| 197 | <ctx.Provider value={value}> |