Jacky Zhao
2023-06-17 917d5791acd6361c691902b445bdc4f7129ba3fc
quartz/components/Body.tsx
@@ -1,17 +1,16 @@
// @ts-ignore
import clipboardScript from './scripts/clipboard.inline'
import clipboardStyle from './styles/clipboard.scss'
import { QuartzComponentProps } from "./types"
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
export default function Body({ fileData, children }: QuartzComponentProps) {
  const title = fileData.frontmatter?.title
  const displayTitle = fileData.slug === "index" ? undefined : title
function Body({ children }: QuartzComponentProps) {
  return <article>
    <div class="top-section">
      {displayTitle && <h1>{displayTitle}</h1>}
    </div>
    {children}
  </article>
}
Body.afterDOMLoaded = clipboardScript
Body.css = clipboardStyle
export default (() => Body) satisfies QuartzComponentConstructor