// Must import reflect-metadata first for class-transformer decorators to work
import "reflect-metadata";

import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import { App, AuthProvider } from "./app";
import { ToastProvider } from "./shared/components/feedback/ToastProvider";
import "./index.css";

// Dev mode: auto login, skip authentication
const DEV_MODE = import.meta.env.DEV && true; // Set to false to restore normal login

ReactDOM.createRoot(document.getElementById("root")!).render(
  <React.StrictMode>
    <BrowserRouter>
      <AuthProvider devMode={DEV_MODE}>
        <ToastProvider>
          <App />
        </ToastProvider>
      </AuthProvider>
    </BrowserRouter>
  </React.StrictMode>
);
