2018-07-23 13:19:24 +00:00
|
|
|
/** @format */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2018-08-20 21:18:13 +00:00
|
|
|
import Rating from './index';
|
2018-07-23 13:19:24 +00:00
|
|
|
|
2018-08-20 21:18:13 +00:00
|
|
|
const ReviewRating = ( { review, ...props } ) => {
|
|
|
|
const rating = ( review && review.rating ) || 0;
|
|
|
|
return <Rating rating={ rating } { ...props } />;
|
|
|
|
};
|
2018-07-23 13:19:24 +00:00
|
|
|
|
|
|
|
ReviewRating.propTypes = {
|
|
|
|
review: PropTypes.object.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ReviewRating;
|