import { ref } from 'vue'
export function useCopy() {
const copied = ref(false)
async function copy(text) {
if (!text) return
await navigator.clipboard.writeText(text)
copied.value = true
setTimeout(() => { copied.value = false }, 1500)
}
return { copied, copy }
}