diff options
| author | Armand Philippot <git@armandphilippot.com> | 2021-12-21 15:20:17 +0100 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2021-12-21 15:20:17 +0100 |
| commit | 926e1df1e9a7de29134293fe2306c9d9ecb594a6 (patch) | |
| tree | d83550ce445525a3993d2f345cb301be5e7403b3 /src/utils | |
| parent | ae17973618c5ad5500ae69738da222187a09b019 (diff) | |
chore: add a table of contents
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/hooks/useHeadingsTree.tsx | 8 |
1 files changed, 1 insertions, 7 deletions
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<Heading[]>([]); const depths = useMemo(() => ['h2', 'h3', 'h4', 'h5', 'h6'], []); |
