feat: ArticleBody renderer and TagRow

This commit is contained in:
achmad
2026-05-28 22:30:32 +07:00
parent cffc2808b5
commit 852646e40c
2 changed files with 34 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
interface Props {
html: string
}
export default function ArticleBody({ html }: Props) {
return (
<div
className="article-body"
dangerouslySetInnerHTML={{ __html: html }}
/>
)
}
+22
View File
@@ -0,0 +1,22 @@
import type { ArticleTag } from '@/lib/types'
interface Props {
tags: ArticleTag[]
}
export default function TagRow({ tags }: Props) {
if (!tags || tags.length === 0) return null
return (
<div className="flex flex-wrap gap-2 pt-7 border-t border-border mt-8">
{tags.map(({ tags_id: tag }) => (
<span
key={tag.id}
className="bg-bg-card border border-border text-text-secondary text-xs px-3 py-1 rounded-sm hover:border-accent hover:text-accent transition-colors cursor-default"
>
{tag.name}
</span>
))}
</div>
)
}