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

export { EditPostPageComponent };
