Skip to content

Commit 418c967

Browse files
committed
fix: replace any types with proper interfaces to fix lint errors
1 parent a336969 commit 418c967

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

web/app/components/base/markdown-blocks/paragraph.tsx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@
66
import * as React from 'react'
77
import 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 (

0 commit comments

Comments
 (0)