mirror of
https://github.com/tuono-labs/tuono
synced 2026-07-25 21:02:45 -07:00
fix: documentation types CI
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user