import React, { Component } from 'react'; import PropTypes from 'prop-types'; import './StudiesItem.styl'; export class StudiesItem extends Component { static propTypes = { onClick: PropTypes.func.isRequired, studyData: PropTypes.object.isRequired, active: PropTypes.bool, }; render() { const { studyDate, studyDescription, modalities, studyAvailable, } = this.props.studyData; const activeClass = this.props.active ? ' active' : ''; const hasDescriptionAndDate = studyDate && studyDescription; return (
{modalities}
{hasDescriptionAndDate ? (
{studyDate}
{studyDescription}
) : (
{studyAvailable ? ( N/A ) : ( Click to load )}
)}
); } getModalitiesStyle = () => { return {}; }; }