"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 { FormLoading } from '../loading/index.mjs';
import { NotFoundPage } from './404-page.mjs';

const NewPostPage = lazy(
  () => import('./new-post-page.internal.mjs').then((m) => ({ default: m.NewPostPage }))
);
function NewPostPageComponent() {
  const { onRouteError } = usePluginOverrides("blog");
  return /* @__PURE__ */ jsx(
    ComposedRoute,
    {
      path: "/blog/new",
      PageComponent: NewPostPage,
      ErrorComponent: DefaultError,
      LoadingComponent: FormLoading,
      NotFoundComponent: NotFoundPage,
      onError: (error) => {
        if (onRouteError) {
          onRouteError("newPost", error, {
            path: `/blog/new`,
            isSSR: typeof window === "undefined"
          });
        }
      }
    }
  );
}

export { NewPostPageComponent };
