import React from 'react';
import { createRoot } from 'react-dom/client';
import { flushSync } from 'react-dom';
import App from './App.jsx';
import './styles.css';

const rootEl = document.getElementById('root');
const root = createRoot(rootEl);

flushSync(() => {
  root.render(
    <React.StrictMode>
      <App />
    </React.StrictMode>,
  );
});

import('./player.js')
  .then(({ initPlayer }) => initPlayer())
  .catch((err) => {
    console.error('Failed to initialise player controller', err);
  });
