fix: documentation types CI

This commit is contained in:
Valerio Ageno
2024-08-18 11:25:14 +02:00
parent 509283adab
commit e853db164d
3 changed files with 5 additions and 10 deletions
@@ -1,9 +1,6 @@
import { Title } from '@mantine/core'
import type { HTMLAttributes } from 'react'
import { Title, type TitleProps } from '@mantine/core'
export default function MdxTitle(
props: HTMLAttributes<HTMLHeadingElement> & { order: number },
): JSX.Element {
export default function MdxTitle(props: TitleProps): JSX.Element {
return (
<Title
data-heading={props.children}
@@ -19,6 +16,4 @@ export default function MdxTitle(
export const h =
(order: 1 | 2 | 3 | 4 | 5 | 6) =>
(props: HTMLAttributes<HTMLHeadingElement>): JSX.Element => (
<MdxTitle order={order} {...props} />
)
(props: TitleProps): JSX.Element => <MdxTitle order={order} {...props} />
@@ -14,7 +14,7 @@ function getHeadingsData(headings: HTMLHeadingElement[]): Heading[] {
for (const heading of headings) {
if (heading.id) {
result.push({
depth: parseInt(heading.getAttribute('data-order'), 10),
depth: parseInt(heading.getAttribute('data-order') || '1', 10),
content: heading.getAttribute('data-heading') || '',
id: heading.id,
getNode: () =>
@@ -70,7 +70,7 @@ export function TableOfContents({
}
const items = filteredHeadings.map((heading, index) => (
<Text<Link>
<Text
key={heading.id}
component={Link}
fz="sm"