blob: 608d299281b357434ad57c8db387f94646d91cfc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
const copyToClipboard = (text, setPopup) => {
navigator
.clipboard.writeText(text)
.then(() => {
setPopup({
content: 'Note content was copied to clipboard',
time: 2000,
})
})
.catch(() => {
setPopup({
content: 'Could not copy to clipboard',
time: 2000,
error: true
})
})
}
export default copyToClipboard
|