chore: rename md comp

This commit is contained in:
Joel
2026-03-05 15:13:41 +08:00
parent 59f826570d
commit 8c6fd6d3a2
4 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
'use client'
import { DirectiveMarkdownRenderer } from './directive-markdown-renderer'
import { MarkdownWithDirective } from '@/app/components/base/markdown-with-directive'
const markdown = `
Were speaking with technical teams to better understand:
@ -29,8 +29,8 @@ export default function RemarkDirectiveTestPage() {
<h1 style={{ fontSize: 20, fontWeight: 600, marginBottom: 16 }}>
remark-directive test page
</h1>
<div>
<DirectiveMarkdownRenderer markdown={markdown} />
<div className="markdown-body">
<MarkdownWithDirective markdown={markdown} />
</div>
</main>
)

View File

@ -2,8 +2,8 @@ import type { Components } from 'react-markdown'
import ReactMarkdown from 'react-markdown'
import remarkDirective from 'remark-directive'
import { visit } from 'unist-util-visit'
import { WithIconItem, WithIconList } from './directive-components'
import { directivePropsSchemas } from './directive-props-schema'
import { WithIconItem, WithIconList } from './markdown-with-directive-components'
import { directivePropsSchemas } from './markdown-with-directive-schema'
type DirectiveNode = {
type?: string
@ -177,11 +177,11 @@ const directiveComponents = {
withiconitem: WithIconItem,
} as unknown as Components
type DirectiveMarkdownRendererProps = {
type MarkdownWithDirectiveProps = {
markdown: string
}
export function DirectiveMarkdownRenderer({ markdown }: DirectiveMarkdownRendererProps) {
export function MarkdownWithDirective({ markdown }: MarkdownWithDirectiveProps) {
const normalizedMarkdown = normalizeDirectiveAttributeBlocks(markdown)
return (

View File

@ -1,5 +1,5 @@
import type { ReactNode } from 'react'
import type { WithIconItemDirectiveProps, WithIconListDirectiveProps } from './directive-props-schema'
import type { WithIconItemDirectiveProps, WithIconListDirectiveProps } from './markdown-with-directive-schema'
type WithIconListProps = WithIconListDirectiveProps & {
children?: ReactNode