import React, {PureComponent} from 'react'; import PropTypes from "prop-types"; /** * Component that displays the main crate with reminder rules. * It includes and rules */ export class Crate extends PureComponent { static get propTypes() { return { rules: PropTypes.array, cart: PropTypes.element, }; } render() { const { rules, cart, } = this.props; return (
{cart} {rules && rules.length > 0 && (
{rules.map((rule, index) => (

{rule.name}: {rule.message}

))}
)}
); } }