File size: 1,344 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { Gridicon, Button, FoldableCard } from '@automattic/components';
import { OfferingItemProps } from './types';

const OfferingItem: React.FC< OfferingItemProps > = ( {
	title,
	titleIcon,
	description,
	highlights,
	buttonTitle,
	expanded,
	clickableHeader = true,
	actionHandler,
	href,
} ) => {
	const header = (
		<div>
			<div className="a4a-offering-item__title-container">
				{ titleIcon }
				<h3 className="a4a-offering-item__title">{ title }</h3>
			</div>
		</div>
	);

	return (
		<FoldableCard
			className="a4a-offering-item__card"
			header={ header }
			expanded={ expanded }
			clickableHeader={ clickableHeader }
		>
			<p className="a4a-offering-item__description">{ description }</p>
			<ul className="a4a-offering-item__card-list">
				{ highlights.map( ( highlightItemText ) => (
					<li className="a4a-offering-item__card-list-item" key={ highlightItemText }>
						<div className="a4a-offering-item__icon-container">
							<Gridicon className="a4a-offering-item__gridicon" icon="checkmark" size={ 18 } />
						</div>
						<span className="a4a-offering-item__text">{ highlightItemText }</span>
					</li>
				) ) }
			</ul>
			<Button className="a4a-offering-item__button" onClick={ actionHandler } href={ href } primary>
				{ buttonTitle }
			</Button>
		</FoldableCard>
	);
};

export default OfferingItem;