File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
web/app/components/base/markdown-blocks Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 66import * as React from 'react'
77import ImageGallery from '@/app/components/base/image-gallery'
88
9- const hasImageChild = ( children : any [ ] ) : boolean => {
10- return children ?. some ( ( child : any ) => 'tagName' in child && child . tagName === 'img' )
9+ interface MdastNode {
10+ tagName ?: string
11+ children ?: MdastNode [ ]
12+ properties ?: Record < string , string >
1113}
1214
13- const Paragraph = ( paragraph : any ) => {
14- const { node } : any = paragraph
15+ interface ParagraphProps {
16+ node : MdastNode
17+ children : React . ReactNode [ ]
18+ }
19+
20+ const hasImageChild = ( children : MdastNode [ ] ) : boolean => {
21+ return children ?. some ( ( child : MdastNode ) => 'tagName' in child && child . tagName === 'img' )
22+ }
23+
24+ const Paragraph = ( paragraph : ParagraphProps ) => {
25+ const { node } = paragraph
1526 const children_node = node . children
1627 if ( children_node && children_node [ 0 ] && 'tagName' in children_node [ 0 ] && children_node [ 0 ] . tagName === 'img' ) {
1728 return (
You can’t perform that action at this time.
0 commit comments