rizaldy.club/quartz/components/Body.tsx

18 lines
551 B
TypeScript
Raw Normal View History

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