import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { App } from './app/App';
import { BenchApp } from './bench/BenchApp';
import { PromptMatrixApp } from './bench/PromptMatrixApp';
import { isBenchRoute, isPromptMatrixRoute } from './bench/route';
import './app/styles.css';

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

if (!root) {
  throw new Error('Bonsai shell root element is missing');
}

createRoot(root).render(
  <StrictMode>
    {isPromptMatrixRoute(window.location)
      ? <PromptMatrixApp />
      : isBenchRoute(window.location)
        ? <BenchApp />
        : <App />}
  </StrictMode>,
);
