forked from bvaughn/react-virtualized
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathContentBox.js
47 lines (39 loc) · 994 Bytes
/
ContentBox.js
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
42
43
44
45
46
47
import * as React from 'react';
import clsx from 'clsx';
import styles from './ContentBox.css';
export function ContentBox({className, children, style}) {
return (
<div className={clsx(styles.ContentBox, className)} style={style}>
{children}
</div>
);
}
export function ContentBoxHeader({text, sourceLink, docsLink}) {
const links = [];
if (sourceLink) {
links.push(
<a className={styles.Link} href={sourceLink} key="sourceLink">
Source
</a>,
);
}
if (sourceLink && docsLink) {
links.push(<span key="separator"> | </span>);
}
if (docsLink) {
links.push(
<a className={styles.Link} href={docsLink} key="docsLink">
Docs
</a>,
);
}
return (
<h1 className={styles.Header}>
{text}
{links.length > 0 && <small className={styles.Small}>{links}</small>}
</h1>
);
}
export function ContentBoxParagraph({children}) {
return <div className={styles.Paragraph}>{children}</div>;
}