-
Notifications
You must be signed in to change notification settings - Fork 149
/
ResultsItem.js
36 lines (33 loc) · 873 Bytes
/
ResultsItem.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
import React from 'react'
import PropTypes from 'prop-types'
const ResultsItem = ({ id, title, url, rating, previewUrl }) => {
return (
<section
key={id}
className="card"
style={{
width: '300px',
display: 'inline-block',
marginRight: '16px',
}}
>
<video src={previewUrl} alt={title} loop autoPlay />
<section className="card-section">
<h5>
<a href={url} target="_blank" rel="noopener noreferrer">
{title}
</a>{' '}
({rating})
</h5>
</section>
</section>
)
}
ResultsItem.propTypes = {
id: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,
url: PropTypes.string.isRequired,
rating: PropTypes.oneOf(['G', 'PG', 'PG-13', 'R']).isRequired,
previewUrl: PropTypes.string.isRequired,
}
export default ResultsItem