Grégoire Delattre 4b26080193
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Update redux state management
Use immer with native javascript objects instead of immutablejs.
2020-04-07 18:22:26 +02:00

22 lines
457 B
JavaScript

import React from "react";
import PropTypes from "prop-types";
export const Genres = ({ genres = [] }) => {
if (!genres || genres.length === 0) {
return null;
}
// Uppercase first genres
const prettyGenres = genres
.map((word) => word[0].toUpperCase() + word.substr(1))
.join(", ");
return (
<span>
<i className="fa fa-tags mr-1" />
{prettyGenres}
</span>
);
};
Genres.propTypes = { genres: PropTypes.array };