import React from 'react';
import ReactDOM from 'react-dom/client';
import { App } from './Components/App/App';
import './index.scss';

function RenderRoot(root: Element | Document): void {
  ReactDOM.createRoot(root.querySelector('#root') as HTMLDivElement).render(
    <React.StrictMode>
      <App root={root}/>
    </React.StrictMode>
  );
}

// Specific for Modeler apps
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace SVGLayoutDesigner {
  // eslint-disable-next-line @typescript-eslint/naming-convention
  export const Render = RenderRoot;
  export const API_FETCH_URL = 'http://localhost:5000';
  export const API_SET_CONTAINER_LIST_URL = 'http://localhost:5000/SetContainerList';
  export const API_GET_FEEDBACK_URL = 'http://localhost:5000/GetFeedback';
}

(window as any).SVGLayoutDesigner = SVGLayoutDesigner;

RenderRoot(document);
