(key: string, value: string | null)
| 22 | const { copy } = useClipboard() |
| 23 | |
| 24 | const handleCopy = async (key: string, value: string | null) => { |
| 25 | if (value) { |
| 26 | const didCopy = await copy(value) |
| 27 | if (!didCopy) return |
| 28 | setCopiedStates((prev) => ({ ...prev, [key]: true })) |
| 29 | setTimeout(() => { |
| 30 | setCopiedStates((prev) => ({ ...prev, [key]: false })) |
| 31 | }, 2000) |
| 32 | } |
| 33 | } |
| 34 | useEffect(() => { |
| 35 | const fetchContents = async () => { |
| 36 | const loadedContents: Record<string, string> = {} |