forked from nodejs/nodejs.dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharticle.tsx
More file actions
37 lines (34 loc) · 909 Bytes
/
article.tsx
File metadata and controls
37 lines (34 loc) · 909 Bytes
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
import React from 'react';
import { PaginationInfo } from '../types';
import AuthorsList from './authors-list';
import EditLink from './edit-link';
import Pagination from './pagination';
import TOC from './toc';
type Props = {
title: string;
html: string;
tableOfContents: string;
authors: string[];
relativePath: string;
next?: PaginationInfo;
previous?: PaginationInfo;
};
const Article = ({
title,
html,
tableOfContents,
previous,
next,
relativePath,
authors,
}: Props) => (
<article className="article-reader">
<h1 className="article-reader__headline">{title}</h1>
<TOC heading="TABLE OF CONTENTS" tableOfContents={tableOfContents} />
<div dangerouslySetInnerHTML={{ __html: html }} />
<AuthorsList authors={authors} />
<EditLink relativePath={relativePath} />
<Pagination previous={previous} next={next} />
</article>
);
export default Article;