"use client";
import { jsx } from 'react/jsx-runtime';
import { lazy } from 'react';
import { usePluginOverrides } from '@btst/stack/context';
import { ComposedRoute } from '@btst/stack/client/components';
import { DefaultError } from '../shared/default-error.mjs';
import { NotFoundPage } from './404-page.mjs';
import { DashboardSkeleton } from '../loading/dashboard-skeleton.mjs';

const DashboardPageInternal = lazy(
  () => import('./dashboard-page.internal.mjs').then((m) => ({
    default: m.DashboardPage
  }))
);
function DashboardPageComponent() {
  const { onRouteError } = usePluginOverrides("cms");
  return /* @__PURE__ */ jsx(
    ComposedRoute,
    {
      path: "/cms",
      PageComponent: DashboardPageInternal,
      ErrorComponent: DefaultError,
      LoadingComponent: DashboardSkeleton,
      NotFoundComponent: NotFoundPage,
      onError: (error) => {
        if (onRouteError) {
          onRouteError("dashboard", error, {
            path: "/cms",
            isSSR: typeof window === "undefined"
          });
        }
      }
    }
  );
}

export { DashboardPageComponent };
