Skip to content
index.tsx 907 B
Newer Older
Grant's avatar
Grant committed
import "./lib/sentry";
Grant's avatar
Grant committed
import React from "react";
import { createRoot } from "react-dom/client";
Grant's avatar
Grant committed
import { NextUIProvider } from "@nextui-org/react";
Grant's avatar
Grant committed
import { ThemeProvider } from "next-themes";
Grant's avatar
Grant committed
import App from "./components/App";

Grant's avatar
Grant committed
import * as Sentry from "@sentry/react";
Grant's avatar
Grant committed

Grant's avatar
Grant committed
let ErrorBoundary = ({ children }: React.PropsWithChildren) => <>{children}</>;
Grant's avatar
Grant committed

Grant's avatar
Grant committed
if (__SENTRY_DSN__) {
  ErrorBoundary = ({ children }) => {
    return <Sentry.ErrorBoundary showDialog>{children}</Sentry.ErrorBoundary>;
  };
Grant's avatar
Grant committed
}

Grant's avatar
Grant committed
const root = createRoot(document.getElementById("root")!);
Grant's avatar
Grant committed
root.render(
  <React.StrictMode>
Grant's avatar
Grant committed
    <ErrorBoundary>
      <NextUIProvider>
Ategon Dev's avatar
Ategon Dev committed
        <ThemeProvider attribute="class" defaultTheme="system">
          <div className="w-screen h-screen bg-[#ddd] dark:bg-[#060606]">
            <App />
          </div>
        </ThemeProvider>
Grant's avatar
Grant committed
      </NextUIProvider>
    </ErrorBoundary>
Grant's avatar
Grant committed
  </React.StrictMode>
);