import { getLandingPageData } from '@akinon/next/data/server';
import { withSegmentDefaults } from '@akinon/next/hocs/server';
import { ResolvedPageProps } from '@akinon/next/types';

async function Page({ params }: ResolvedPageProps<{ pk: number }>) {
  const data = await getLandingPageData({ pk: params.pk });

  const content = data.landing_page;

  return (
    <div className="container mx-auto py-6">
      <div className="mx-auto prose prose-headings:text-primary">
        Landing page {JSON.stringify(content)}
      </div>
    </div>
  );
}

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