Grégoire Delattre ae7c752e43
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Handle the torrent state in the torrent page
2020-04-16 11:06:41 +02:00

22 lines
470 B
JavaScript

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