import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { QueryClientProvider } from "@tanstack/react-query";

import { App } from "./app";
import { ConfigProvider } from "./config/config-provider";
import { makeQueryClient } from "./api/query-client";
import { ToastRegion } from "./components/ui/toast";
import "./index.css";
import "./i18n";

const queryClient = makeQueryClient();

createRoot(document.getElementById("root")!).render(
  <StrictMode>
    <QueryClientProvider client={queryClient}>
      <ConfigProvider>
        <ToastRegion>
          <App />
        </ToastRegion>
      </ConfigProvider>
    </QueryClientProvider>
  </StrictMode>,
);
