"use client";
'use strict';

const jsxRuntime = require('react/jsx-runtime');
const React = require('react');
const context = require('@btst/stack/context');
const components = require('@btst/stack/client/components');
const defaultError = require('../shared/default-error.cjs');
const index = require('../loading/index.cjs');
const _404Page = require('./404-page.cjs');

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

exports.NewPostPageComponent = NewPostPageComponent;
