import { useState, useEffect } from 'react'; import { X, BarChart3 } from 'lucide-react'; import { ProfilerService } from '../services/ProfilerService'; import { AdvancedProfiler } from './AdvancedProfiler'; import '../styles/ProfilerWindow.css'; interface AdvancedProfilerWindowProps { onClose: () => void; } interface WindowWithProfiler extends Window { __PROFILER_SERVICE__?: ProfilerService; } export function AdvancedProfilerWindow({ onClose }: AdvancedProfilerWindowProps) { const [profilerService, setProfilerService] = useState(null); const [isConnected, setIsConnected] = useState(false); useEffect(() => { const service = (window as WindowWithProfiler).__PROFILER_SERVICE__; if (service) { setProfilerService(service); } }, []); useEffect(() => { if (!profilerService) return; const checkStatus = () => { setIsConnected(profilerService.isConnected()); }; checkStatus(); const interval = setInterval(checkStatus, 1000); return () => clearInterval(interval); }, [profilerService]); return (
e.stopPropagation()} style={{ width: '90vw', height: '85vh', maxWidth: '1600px' }} >

Advanced Performance Profiler

{!isConnected && ( DISCONNECTED )}
); }