All files / react/components/SideNav/Links CmsSwitchLink.jsx

50% Statements 2/4
100% Branches 0/0
0% Functions 0/2
50% Lines 2/4

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        2x                                                         2x              
import PropTypes from "prop-types";
import { handleNavigation } from "../helpers";
import { SwitchPractice, ChevronRight } from "../../../lib/SvgComponents.jsx";
 
const CmsSwitchLink = ({ linkCallback, url, label }) => {
  return (
    <div className="switch-container">
      <a
        href={url}
        onClick={(e) => handleNavigation(e, linkCallback, label)}
        className="switch-link"
      >
        <div className="button-partition">
          <svg className="icon">
            <SwitchPractice />
            <title>Switch Practice Icon</title>
          </svg>
          <span>{label}</span>
        </div>
        <div className="button-partition">
          <svg
            className="icon right-icon rotated"
            aria-hidden="true"
            focusable="false"
          >
            <ChevronRight />
          </svg>
        </div>
      </a>
    </div>
  );
};
 
CmsSwitchLink.propTypes = {
  linkCallback: PropTypes.func,
  url: PropTypes.string,
  label: PropTypes.string,
};
 
export default CmsSwitchLink;