feat: ArticleBody renderer and TagRow
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
interface Props {
|
||||
html: string
|
||||
}
|
||||
|
||||
export default function ArticleBody({ html }: Props) {
|
||||
return (
|
||||
<div
|
||||
className="article-body"
|
||||
dangerouslySetInnerHTML={{ __html: html }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user