
import React from 'react';
import ReactDOM from 'react-dom/client';
import { HelmetProvider } from 'react-helmet-async';
import App from './App';
import './i18n/i18n';
import './index.css';
import { initializeFilterData } from '@/data/filterData';
import { orchestrateSitemapGeneration } from '@/utils/sitemapOrchestrator';

const originalConsoleError = console.error;
console.error = function(...args) {
  const errorString = args.join(' ').toLowerCase();
  if (errorString.includes('unsafe_componentwillmount') || 
      errorString.includes('sideeffect')) {
    return;
  }
  
  originalConsoleError.apply(console, args);
};

initializeFilterData().then(() => {
  orchestrateSitemapGeneration();
  ReactDOM.createRoot(document.getElementById('root')).render(
    <React.StrictMode>
      <HelmetProvider>
        <App />
      </HelmetProvider>
    </React.StrictMode>
  );
});
