KyivKrishnaAcademy/ved_akadem_students

View on GitHub
client/app/bundles/ScheduleList/components/LinkOrText.jsx

Summary

Maintainability
A
50 mins
Test Coverage
import React, { PropTypes } from 'react';

const LinkOrText = ({ condition, path, text }) => {
  if (condition) { return (<a href={path}>{text}</a>); }

  return <span>{text}</span>;
};

LinkOrText.propTypes = {
  condition: PropTypes.bool.isRequired,
  path: PropTypes.string.isRequired,
  text: PropTypes.string.isRequired,
};

export default LinkOrText;