department-of-veterans-affairs/vets-website

View on GitHub
src/applications/check-in/components/AppointmentDisplay/AppointmentLocation.jsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';

const AppointmentLocation = ({ appointment, bold }) => {
  let display;

  if (appointment.clinicFriendlyName) {
    display = appointment.clinicFriendlyName;
  } else {
    display = appointment.clinicName;
  }
  if (bold) {
    return <span className="vads-u-font-weight--bold">{display}</span>;
  }
  return <>{display}</>;
};

AppointmentLocation.propTypes = {
  appointment: PropTypes.object,
  bold: PropTypes.bool,
};

export default AppointmentLocation;