main.jsx

/**
 * @file
 * File : main.jsx\
 * Entry point of the app\
 * Creates the state provider and renders the React components
 *
 * @category Files
 * @author  Pierre-Yves Léglise <contact@axialdata.net>
 * @name main
 */

import React from 'react'
import ReactDOM from 'react-dom/client'
import config from '../src/app/config'
import { Provider } from 'react-redux'
import store from './app/store'
import App from './app/App.jsx'
import { disableReactDevTools } from '@fvilers/disable-react-devtools'
import ConfigLoader from './features/SystemSettings/ConfigLoader'

// Check if the environment is not development and disable React DevTools if true
const isDeveloppement = config.frontend.mode === 'developpement'
if (!isDeveloppement) disableReactDevTools()
// const appName = config.frontend.appMainName

/**
 * Renders the application.
 *
 * @function
 * @author  Pierre-Yves Léglise <contact@axialdata.net>
 * @param {Object} props - Props for the application.
 * @example
 *  ReactDOM.createRoot(document.getElementById('root')).render(<App />)
 * @returns {JSX.Element} The rendered application.
 */

ReactDOM.createRoot(document.getElementById('root')).render(
  <Provider store={store}>
    <React.StrictMode>
      <ConfigLoader />
      <App />
    </React.StrictMode>
  </Provider>
)