import { StrictMode } from 'react'
import ReactDOM from 'react-dom/client'
import Settings from '@/Settings'
import '@/gui.css'

const renderSettingsGui = () => {
  const rootContainer = document.getElementById('extensions_settings')

  if (rootContainer === null) {
    throw new Error('[st-randomness-helpers] root container not found')
  }

  const rootElement = document.createElement('div')

  rootContainer.appendChild(rootElement)

  ReactDOM.createRoot(rootElement).render(
    <StrictMode>
      <Settings />
    </StrictMode>
  )
}

export default renderSettingsGui
