2023-11-15 22:21:04 +00:00
|
|
|
import { JSX } from 'solid-js'
|
|
|
|
|
2023-11-15 21:51:32 +00:00
|
|
|
import { PageLayout } from '../_shared/PageLayout'
|
|
|
|
import { TableOfContents } from '../TableOfContents'
|
|
|
|
|
2023-12-13 10:39:31 +00:00
|
|
|
type Props = {
|
2023-11-15 21:51:32 +00:00
|
|
|
title: string
|
|
|
|
children: JSX.Element
|
2023-12-13 10:39:31 +00:00
|
|
|
}
|
|
|
|
export const StaticPage = (props: Props) => {
|
|
|
|
const articleBodyElement: { current: HTMLElement } = { current: null }
|
2023-11-15 21:51:32 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<PageLayout title={props.title}>
|
|
|
|
<div class="wide-container">
|
|
|
|
<div class="row">
|
|
|
|
<article
|
|
|
|
class="col-md-16 col-lg-14 col-xl-12 offset-md-5"
|
|
|
|
id="articleBody"
|
2023-12-13 10:39:31 +00:00
|
|
|
ref={(el) => (articleBodyElement.current = el)}
|
2023-11-15 21:51:32 +00:00
|
|
|
>
|
|
|
|
{props.children}
|
|
|
|
</article>
|
|
|
|
|
|
|
|
<div class="col-md-6 offset-md-1">
|
2023-11-15 21:56:31 +00:00
|
|
|
<TableOfContents
|
|
|
|
variant="article"
|
|
|
|
parentSelector="#articleBody"
|
2023-12-13 10:39:31 +00:00
|
|
|
body={articleBodyElement.current.outerHTML}
|
2023-11-15 21:56:31 +00:00
|
|
|
/>
|
2023-11-15 21:51:32 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</PageLayout>
|
|
|
|
)
|
|
|
|
}
|