All files / react/components/SideNav/Details PracticeDetails.jsx

12.5% Statements 2/16
0% Branches 0/14
0% Functions 0/2
12.5% Lines 2/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51    2x                                                                         2x                      
import PropTypes from "prop-types";
 
const PracticeDetails = ({
  practiceName,
  practiceTin,
  apmEntityId,
  vgId,
  cpcPlusId,
  pcfId,
  subgroupId,
}) => {
  function renderId() {
    if (cpcPlusId) {
      return <p className="practice-tin">CPC+ ID: {cpcPlusId}</p>;
    } else if (pcfId) {
      return <p className="practice-tin">PCF ID: {pcfId}</p>;
    } else if (apmEntityId) {
      return <p className="practice-tin">APM Entity ID: {apmEntityId}</p>;
    } else if (vgId) {
      return <p className="practice-tin">VG ID: {vgId}</p>;
    } else if (practiceTin) {
      return <p className="practice-tin">TIN: {practiceTin}</p>;
    } else if (subgroupId) {
      return (
        <p className="practice-tin subgroup-id">Subgroup ID: {subgroupId}</p>
      );
    } else {
      return;
    }
  }
 
  return (
    <div className="practice-container">
      <h2 className="practice-name">{practiceName || "No name on record"}</h2>
      {renderId()}
    </div>
  );
};
 
PracticeDetails.propTypes = {
  practiceName: PropTypes.string,
  practiceTin: PropTypes.string,
  subgroupId: PropTypes.string,
  apmEntityId: PropTypes.string,
  vgId: PropTypes.string,
  cpcPlusId: PropTypes.string,
  pcfId: PropTypes.string,
};
 
export default PracticeDetails;