import { ref } from 'vue'; export const INSTALL_COMMAND = 'npx @johanleroy/git-arboretum'; // Bouton « copier la commande » : copie + bascule le label 1800 ms (fidèle au design). export function useCopy() { const copied = ref(false); let timer: ReturnType | undefined; async function copy(text: string = INSTALL_COMMAND): Promise { try { if (navigator.clipboard) await navigator.clipboard.writeText(text); } catch { /* clipboard indisponible (contexte non sécurisé) */ } copied.value = true; clearTimeout(timer); timer = setTimeout(() => { copied.value = false; }, 1800); } return { copied, copy }; }