forked from nodejs/nodejs.dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharticle.tsx
More file actions
30 lines (27 loc) · 962 Bytes
/
article.tsx
File metadata and controls
30 lines (27 loc) · 962 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
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';
interface 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): JSX.Element => (
<article className="article-reader">
<h1 className="article-reader__headline">{title}</h1>
<TOC heading="TABLE OF CONTENTS" tableOfContents={tableOfContents} />
{/* eslint-disable-next-line react/no-danger */}
<div dangerouslySetInnerHTML={{ __html: html }} />
<AuthorsList authors={authors} />
<EditLink relativePath={relativePath} />
<Pagination previous={previous} next={next} />
</article>
);
export default Article;