import { useState } from 'react'; import { motion } from 'framer-motion'; import { Bug, Package, AlertCircle, CheckCircle2, Copy, Check, ArrowLeft } from 'lucide-react'; interface DebugPageProps { onBack?: () => void; } export default function DebugPage({ onBack }: DebugPageProps) { const [creating, setCreating] = useState(false); const [anonymize, setAnonymize] = useState(true); const [bundlePath, setBundlePath] = useState(''); const [error, setError] = useState(''); const [copied, setCopied] = useState(false); const handleCreateBundle = async () => { try { setCreating(true); setError(''); setBundlePath(''); setCopied(false); // TODO: Implement debug bundle creation via IPC // const path = await window.electronAPI.daemon.createDebugBundle(anonymize); // setBundlePath(path); // Simulated for now await new Promise((resolve) => setTimeout(resolve, 2000)); setBundlePath('/tmp/netbird-debug-bundle-20241030.zip'); } catch (err) { setError('Failed to create debug bundle'); console.error('Debug bundle error:', err); } finally { setCreating(false); } }; const handleCopyPath = async () => { try { await navigator.clipboard.writeText(bundlePath); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch (err) { console.error('Failed to copy path:', err); } }; return (
{/* Back Button */} {onBack && ( Back )} {/* Header */}

Debug Bundle

Create diagnostic bundle for troubleshooting

{/* Info Card */}

What's included?

  • • System information
  • • NetBird configuration
  • • Network interfaces
  • • Routing tables
  • • Daemon logs
{/* Anonymize option */}
setAnonymize(!anonymize)} >

Anonymize sensitive data

Replace IP addresses, emails, and other identifying information

{/* Create Button */} {creating ? 'Creating Bundle...' : 'Create Debug Bundle'} {/* Success message */} {bundlePath && (

Bundle Created!

Your debug bundle has been created successfully

File location:

{bundlePath}

)} {/* Error message */} {error && (

Error

{error}

)} {/* Additional Info */}

Need Help?

If you're experiencing issues, create a debug bundle and share it with the NetBird support team.

Report an issue on GitHub →
); }