import isUndefined from 'lodash/isUndefined'; import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; import { Container, Grid } from 'semantic-ui-react'; import Paths from '../../constants/Paths'; import ProjectWrapperContainer from '../../containers/ProjectWrapperContainer'; import { ReactComponent as PlusIcon } from '../../assets/images/plus-icon.svg'; import styles from './Projects.module.css'; const Projects = React.memo(({ items, currentId, isEditable, onAdd }) => { const [t] = useTranslation(); if (isUndefined(currentId)) { return ( {items.map(item => (
{item.notificationsTotal > 0 && ( {item.notificationsTotal} )}
{item.name}
))} {isEditable && ( )} ); } return (
); }); Projects.propTypes = { items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types currentId: PropTypes.string, isEditable: PropTypes.bool.isRequired, onAdd: PropTypes.func.isRequired, }; Projects.defaultProps = { currentId: undefined, }; export default Projects;