summaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2021-12-21 15:20:17 +0100
committerArmand Philippot <git@armandphilippot.com>2021-12-21 15:20:17 +0100
commit926e1df1e9a7de29134293fe2306c9d9ecb594a6 (patch)
treed83550ce445525a3993d2f345cb301be5e7403b3 /src/utils
parentae17973618c5ad5500ae69738da222187a09b019 (diff)
chore: add a table of contents
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/hooks/useHeadingsTree.tsx8
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'], []);