MetaPhase-Consulting/State-TalentMAP

View on GitHub
src/Components/AutoSuggest/SuggestionChoicePost/SuggestionChoicePost.jsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import PropTypes from 'prop-types';
import { getPostName } from '../../../utilities';

const SuggestionChoicePost = ({ suggestion }) => (
  <div className="render-suggestion render-suggestion--post">
    {getPostName(suggestion)}{suggestion.hasDuplicateDescription && suggestion.code ? ` (${suggestion.code})` : ''}
  </div>
);

SuggestionChoicePost.propTypes = {
  suggestion: PropTypes.shape({
    location: PropTypes.shape({}),
    hasDuplicateDescription: PropTypes.bool,
    code: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
  }).isRequired,
};

export default SuggestionChoicePost;