blob: afaf7f6ff97efc8a700577e81bdf63bfe198faf9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
const copyToClipboard = (text, t, setPopup) => {
navigator
.clipboard.writeText(text)
.then(() => {
setPopup({
content: t('notes_copy_success'),
time: 2000,
})
})
.catch(() => {
setPopup({
content: t('notes_copy_error'),
time: 2000,
error: true
})
})
}
export default copyToClipboard
|