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

exports.TagPageComponent = TagPageComponent;
