import './assets/base.css'
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import { ErrorBoundary } from './components/ErrorBoundary'
import { mockApi } from './mockApi'

// In the standalone UI preview (browser, no Electron preload) window.api isn't
// injected. Install the mock surface (mockApi.ts) so the UI renders and stays
// interactive during design work. In the real Electron app this branch is
// skipped — preload provides the real window.api.
if (import.meta.env.DEV && !window.api) {
  window.api = mockApi
}

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
  <React.StrictMode>
    <ErrorBoundary>
      <App />
    </ErrorBoundary>
  </React.StrictMode>
)
