import React from "react";
import { createRoot } from "react-dom/client";
import App from "./app/app";
import { AuthProvider } from "./app/AuthContext";
import { buildOmsorgApi } from "./api/index.js";
import "./style.css";

// Ersetzt electron/preload.cjs' contextBridge.exposeInMainWorld("omsorg", ...) - AuthContext.jsx
// und alle src/modules/**-Aufrufstellen greifen unverändert auf window.omsorg zu.
window.omsorg = buildOmsorgApi();

createRoot(document.getElementById("root")).render(
  <React.StrictMode>
    <AuthProvider>
      <App />
    </AuthProvider>
  </React.StrictMode>
);