wiki/quartz/components/Body.tsx

18 lines
551 B
TypeScript
Raw Normal View History

2023-06-07 04:19:00 +00:00
import clipboardScript from './scripts/clipboard.inline'
import clipboardStyle from './styles/clipboard.scss'
2023-06-08 05:27:32 +00:00
import { QuartzComponentProps } from "./types"
2023-06-07 04:19:00 +00:00
2023-06-08 05:27:32 +00:00
export default function Body({ fileData, children }: QuartzComponentProps) {
const title = fileData.frontmatter?.title
const displayTitle = fileData.slug === "index" ? undefined : title
2023-06-07 04:19:00 +00:00
return <article>
2023-06-08 05:27:32 +00:00
<div class="top-section">
{displayTitle && <h1>{displayTitle}</h1>}
</div>
2023-06-07 04:19:00 +00:00
{children}
</article>
}
Body.afterDOMLoaded = clipboardScript
Body.css = clipboardStyle