export const useClipboard = () => { const copyTextToClipboard = async (text: string, onSuccess: () => void, onError: () => void) => { try { await navigator.clipboard.writeText(text); onSuccess(); } catch (err) { onError(); } }; return { copyTextToClipboard, }; };