-
Notifications
You must be signed in to change notification settings - Fork 5
/
EmptyState.js
73 lines (65 loc) · 1.46 KB
/
EmptyState.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import * as React from "react";
import PropTypes from "prop-types";
import Text, { fontTypes, fontSizes } from "@crave/farmblocks-text";
import Container from "./styledComponents/Container";
import Buttons from "./Buttons";
import Thumbnail from "./Thumbnail";
const EmptyState = ({
className,
imageSrc,
icon,
title,
description,
actions,
info,
}) => (
<Container className={className}>
<Thumbnail imageSrc={imageSrc} icon={icon} />
<Text
className="title"
fontWeight="title"
align="center"
size={fontSizes.HUGE}
type={fontTypes.NORMAL}
>
{title}
</Text>
{description && (
<Text
className="description"
align="center"
size={fontSizes.LARGE}
type={fontTypes.NEUTRAL}
>
{description}
</Text>
)}
<Buttons actions={actions} />
{info && (
<Text
className="info"
align="center"
size={fontSizes.SMALL}
type={fontTypes.NEUTRAL}
>
{info}
</Text>
)}
</Container>
);
EmptyState.propTypes = {
title: PropTypes.string.isRequired,
imageSrc: PropTypes.string,
description: PropTypes.string,
actions: PropTypes.arrayOf(
PropTypes.shape({
text: PropTypes.string.isRequired,
type: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired,
}),
),
info: PropTypes.string,
icon: PropTypes.node,
className: PropTypes.string,
};
export default EmptyState;