()
| 30 | }, [isOpen]); |
| 31 | |
| 32 | const fetchDebugInfo = async () => { |
| 33 | setLoading(true); |
| 34 | try { |
| 35 | const info = await getDebugInfo(); |
| 36 | setDebugInfo({ |
| 37 | ...info, |
| 38 | userAgent: navigator.userAgent, |
| 39 | timestamp: new Date().toISOString(), |
| 40 | windowSize: `${window.innerWidth}x${window.innerHeight}`, |
| 41 | }); |
| 42 | } catch (err) { |
| 43 | console.error("Failed to fetch debug info", err); |
| 44 | setDebugInfo({ error: "Failed to fetch debug info from backend" }); |
| 45 | } finally { |
| 46 | setLoading(false); |
| 47 | } |
| 48 | }; |
| 49 | |
| 50 | const copyToClipboard = () => { |
| 51 | if (debugInfo) { |
no test coverage detected