2023-06-12 15:46:38 +09:00
|
|
|
import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
2024-01-30 14:51:13 +09:00
|
|
|
import { classNames } from "../util/lang"
|
2023-06-10 15:06:02 +09:00
|
|
|
|
2023-10-02 09:20:55 +09:00
|
|
|
function ArticleTitle({ fileData, displayClass }: QuartzComponentProps) {
|
2023-06-10 15:06:02 +09:00
|
|
|
const title = fileData.frontmatter?.title
|
2023-07-03 05:08:29 +09:00
|
|
|
if (title) {
|
2024-01-30 14:51:13 +09:00
|
|
|
return <h1 class={classNames(displayClass, "article-title")}>{title}</h1>
|
2023-06-10 15:06:02 +09:00
|
|
|
} else {
|
|
|
|
return null
|
|
|
|
}
|
|
|
|
}
|
2023-06-19 02:47:07 +09:00
|
|
|
ArticleTitle.css = `
|
|
|
|
.article-title {
|
|
|
|
margin: 2rem 0 0 0;
|
|
|
|
}
|
|
|
|
`
|
2023-06-12 15:46:38 +09:00
|
|
|
|
|
|
|
export default (() => ArticleTitle) satisfies QuartzComponentConstructor
|