"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 EditPostPage = React.lazy(
  () => import('./edit-post-page.internal.cjs').then((m) => ({
    default: m.EditPostPage
  }))
);
function EditPostPageComponent({ slug }) {
  const { onRouteError } = context.usePluginOverrides("blog");
  return /* @__PURE__ */ jsxRuntime.jsx(
    components.ComposedRoute,
    {
      path: `/blog/${slug}/edit`,
      PageComponent: EditPostPage,
      ErrorComponent: defaultError.DefaultError,
      LoadingComponent: index.FormLoading,
      NotFoundComponent: _404Page.NotFoundPage,
      props: { slug },
      onError: (error) => {
        if (onRouteError) {
          onRouteError("editPost", error, {
            path: `/blog/${slug}/edit`,
            isSSR: typeof window === "undefined",
            slug
          });
        }
      }
    }
  );
}

exports.EditPostPageComponent = EditPostPageComponent;
