-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathindex.jsx
More file actions
41 lines (37 loc) · 1.2 KB
/
index.jsx
File metadata and controls
41 lines (37 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import MetaBar from '@node-core/ui-components/Containers/MetaBar';
import AvatarGroup from '@node-core/ui-components/Common/AvatarGroup';
import GitHubIcon from '@node-core/ui-components/Icons/Social/GitHub';
import { authors } from '../config.json' with { type: 'json' };
/**
* @typedef MetaBarProps
* @property {Array<import('@vcarl/remark-headings').Heading>} headings
* @property {string} readingTime
* @property {Array<[string, string]>} viewAs
* @property {string} editThisPage
*/
/** @param {MetaBarProps} props */
export default ({ headings = [], readingTime, viewAs = [], editThisPage }) => {
const pageAuthors = authors[editThisPage];
return (
<MetaBar
heading="Table of Contents"
headings={{ items: headings }}
items={{
'Reading Time': readingTime,
...(CLIENT && pageAuthors?.length
? {
Authors: (
<AvatarGroup avatars={pageAuthors} as="a" clickable limit={5} />
),
}
: {}),
Contribute: (
<>
<GitHubIcon className="fill-neutral-700 dark:fill-neutral-100" />
<a href={editThisPage}>Edit this page</a>
</>
),
}}
/>
);
};