From e853db164dbe639bef0a71303c55ba5ccd10cf06 Mon Sep 17 00:00:00 2001 From: Valerio Ageno Date: Sun, 18 Aug 2024 11:25:14 +0200 Subject: [PATCH] fix: documentation types CI --- .../components/mdx-provider/mdx-title/mdx-title.tsx | 11 +++-------- .../src/components/table-of-content/get-headings.ts | 2 +- .../components/table-of-content/table-of-content.tsx | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/documentation/src/components/mdx-provider/mdx-title/mdx-title.tsx b/apps/documentation/src/components/mdx-provider/mdx-title/mdx-title.tsx index 7a070a5f..c445250d 100644 --- a/apps/documentation/src/components/mdx-provider/mdx-title/mdx-title.tsx +++ b/apps/documentation/src/components/mdx-provider/mdx-title/mdx-title.tsx @@ -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 & { order: number }, -): JSX.Element { +export default function MdxTitle(props: TitleProps): JSX.Element { return ( - (props: HTMLAttributes<HTMLHeadingElement>): JSX.Element => ( - <MdxTitle order={order} {...props} /> - ) + (props: TitleProps): JSX.Element => <MdxTitle order={order} {...props} /> diff --git a/apps/documentation/src/components/table-of-content/get-headings.ts b/apps/documentation/src/components/table-of-content/get-headings.ts index 3c94ae3c..2c0a50a8 100644 --- a/apps/documentation/src/components/table-of-content/get-headings.ts +++ b/apps/documentation/src/components/table-of-content/get-headings.ts @@ -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: () => diff --git a/apps/documentation/src/components/table-of-content/table-of-content.tsx b/apps/documentation/src/components/table-of-content/table-of-content.tsx index ceae4439..12826f3b 100644 --- a/apps/documentation/src/components/table-of-content/table-of-content.tsx +++ b/apps/documentation/src/components/table-of-content/table-of-content.tsx @@ -70,7 +70,7 @@ export function TableOfContents({ } const items = filteredHeadings.map((heading, index) => ( - <Text<Link> + <Text key={heading.id} component={Link} fz="sm"