|
|
|
@ -1,13 +1,10 @@ |
|
|
|
|
import { MDXRemote, MDXRemoteSerializeResult } from "next-mdx-remote"; |
|
|
|
|
import React, { ComponentType } from "react"; |
|
|
|
|
import React from "react"; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
createLink, |
|
|
|
|
LinkProps, |
|
|
|
|
OrganizedContent, |
|
|
|
|
} from "@/components/OrganizedContent"; |
|
|
|
|
import { createLink, OrganizedContent } from "@/components/OrganizedContent"; |
|
|
|
|
|
|
|
|
|
import { Header } from "./Header"; |
|
|
|
|
import { Options } from "./ReadAll"; |
|
|
|
|
|
|
|
|
|
interface Section { |
|
|
|
|
id: string; |
|
|
|
@ -20,19 +17,24 @@ export interface Props { |
|
|
|
|
current: number; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export interface Options { |
|
|
|
|
title: string; |
|
|
|
|
pagePath: string; |
|
|
|
|
image: string; |
|
|
|
|
link?: ComponentType<LinkProps>; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export function createSectionPage({ title, image, pagePath, link }: Options) { |
|
|
|
|
export function createSectionPage({ |
|
|
|
|
title, |
|
|
|
|
image, |
|
|
|
|
pagePath, |
|
|
|
|
link, |
|
|
|
|
description, |
|
|
|
|
imagePosition, |
|
|
|
|
}: Options) { |
|
|
|
|
const Link = link ?? createLink(pagePath); |
|
|
|
|
|
|
|
|
|
return function Page(this: void, { content, sections, current }: Props) { |
|
|
|
|
return ( |
|
|
|
|
<Header title={title} image={image}> |
|
|
|
|
<Header |
|
|
|
|
title={title} |
|
|
|
|
image={image} |
|
|
|
|
description={description} |
|
|
|
|
imagePosition={imagePosition} |
|
|
|
|
> |
|
|
|
|
<OrganizedContent |
|
|
|
|
sections={sections} |
|
|
|
|
id={sections[current].id} |
|
|
|
|