keroosha.cybergulag.today/quartz/components/ArticleTitle.tsx

18 lines
454 B
TypeScript
Raw Permalink Normal View History

2023-06-12 09:46:38 +03:00
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
2023-06-10 09:06:02 +03:00
function ArticleTitle({ fileData, displayClass }: QuartzComponentProps) {
2023-06-10 09:06:02 +03:00
const title = fileData.frontmatter?.title
2023-07-02 23:08:29 +03:00
if (title) {
return <h1 class={`article-title ${displayClass ?? ""}`}>{title}</h1>
2023-06-10 09:06:02 +03:00
} else {
return null
}
}
2023-06-18 20:47:07 +03:00
ArticleTitle.css = `
.article-title {
margin: 2rem 0 0 0;
}
`
2023-06-12 09:46:38 +03:00
export default (() => ArticleTitle) satisfies QuartzComponentConstructor