Skip to content

Commit

Permalink
fix: documentation types CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerioageno committed Aug 18, 2024
1 parent 509283a commit e853db1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -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}
Expand All @@ -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} />
Original file line number Diff line number Diff line change
Expand Up @@ -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: () =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function TableOfContents({
}

const items = filteredHeadings.map((heading, index) => (
<Text<Link>
<Text
key={heading.id}
component={Link}
fz="sm"
Expand Down

0 comments on commit e853db1

Please sign in to comment.