From 926e1df1e9a7de29134293fe2306c9d9ecb594a6 Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Tue, 21 Dec 2021 15:20:17 +0100 Subject: chore: add a table of contents --- src/utils/hooks/useHeadingsTree.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/utils/hooks/useHeadingsTree.tsx') diff --git a/src/utils/hooks/useHeadingsTree.tsx b/src/utils/hooks/useHeadingsTree.tsx index 8bb70c8..94d3b4b 100644 --- a/src/utils/hooks/useHeadingsTree.tsx +++ b/src/utils/hooks/useHeadingsTree.tsx @@ -1,13 +1,7 @@ +import { Heading } from '@ts/types/app'; import { slugify } from '@utils/helpers/slugify'; import { useCallback, useEffect, useMemo, useState } from 'react'; -type Heading = { - depth: number; - id: string; - children: Heading[]; - title: string; -}; - const useHeadingsTree = (wrapper: string) => { const [headingsTree, setHeadingsTree] = useState([]); const depths = useMemo(() => ['h2', 'h3', 'h4', 'h5', 'h6'], []); -- cgit v1.2.3