This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCallback, useState } from "react"; | |
// Custom hook to copy text to clipboard | |
const useCopyToClipboard = (timeoutDuration: number = 1000) => { | |
const [copied, setCopied] = useState(false); | |
const [error, setError] = useState<Error | null>(null); | |
const copyToClipboard = useCallback( | |
async (text: string) => { | |
try { |