import ThemePlaceholder from '@akinon/pz-theme/src/theme-placeholder';
import { withSegmentDefaults } from '@akinon/next/hocs/server';
import { ResolvedPageProps } from '@akinon/next/types';
import { buildCustomPageContext } from '@theme/utils/theme-page-context';

export const dynamic = 'force-dynamic';

async function Page({ params }: ResolvedPageProps<{ slug: string }>) {
  return (
    <div className="min-h-screen">
      <ThemePlaceholder
        slug={`page-${params.slug}`}
        pageContext={buildCustomPageContext(params.slug)}
      />
    </div>
  );
}

export default withSegmentDefaults(Page, { segmentType: 'page' });
