import React, { ErrorInfo, ReactNode } from 'react'; import { createRoot } from 'react-dom/client'; import './index.css'; import Router from './components/Router.tsx'; import { DataProvider } from './components/DataContext.tsx'; interface ErrorBoundaryProps { children?: ReactNode; } interface ErrorBoundaryState { hasError: boolean; error?: Error; } // ErrorBoundary class component to catch rendering errors in its child component tree and display a fallback UI. // Fixed property access errors by using explicit member declarations which ensures 'state' and 'props' are correctly typed and accessible. class ErrorBoundary extends React.Component { // Explicitly defining state and props to resolve "Property 'state'/'props' does not exist" errors. public state: ErrorBoundaryState; public props: ErrorBoundaryProps; constructor(props: ErrorBoundaryProps) { super(props); // Initialize component state correctly. this.state = { hasError: false }; } static getDerivedStateFromError(error: Error): ErrorBoundaryState { return { hasError: true, error }; } componentDidCatch(error: Error, errorInfo: ErrorInfo) { console.error("OneQlek Application Crash:", error, errorInfo); } render() { // Access state through this.state. if (this.state.hasError) { return (

Initialization Error

We encountered a technical issue while loading the dashboard engine. This usually happens due to a module resolution conflict.

{/* Display error information if caught to aid debugging. */} {this.state.error && (
                {this.state.error.stack || this.state.error.toString()}
              
)}
); } // Access props through this.props. return this.props.children; } } const container = document.getElementById('root'); if (container) { try { const root = createRoot(container); root.render( ); // Smooth transition from loader to application requestAnimationFrame(() => { const loader = document.getElementById('initial-loader'); if (loader) { setTimeout(() => { // Cast to HTMLElement to ensure 'style' property exists. (loader as HTMLElement).style.opacity = '0'; setTimeout(() => loader.remove(), 500); }, 800); // Slight delay for visual comfort } }); } catch (err) { console.error("Critical mounting failure:", err); } } else { console.error("Target container '#root' not found in DOM."); }