import {createRoot} from 'react-dom/client';
import App from './App.tsx';
import { ErrorBoundary } from './components/ErrorBoundary.tsx';
import './index.css';

const rootEl = document.getElementById('root');
if (rootEl) {
  if (!rootEl.hasAttribute('data-al-kisa-mounted')) {
    rootEl.setAttribute('data-al-kisa-mounted', 'true');
    createRoot(rootEl).render(
      <ErrorBoundary>
        <App />
      </ErrorBoundary>
    );
  }
} else {
  console.error('Al Kisa Platform: Failed to find #root mount point in DOM');
}
