All files / publisher-admin/components/SectionHeader SectionHeader.tsx

100% Statements 2/2
100% Branches 2/2
100% Functions 1/1
100% Lines 2/2

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            1x   1x                                
import { useRecoilValue } from "recoil";
import { packageDataState } from "../../state/atoms";
 
import type { Package } from "../../types";
 
function SectionHeader() {
  const packageData = useRecoilValue<Package | undefined>(packageDataState);
 
  return (
    <section className="p-strip--grey is-shallow">
      <div className="u-fixed-width">
        <a href="/charms">&lsaquo;&nbsp;My charms &amp; bundles</a>
        {packageData && (
          <h1 className="p-heading--3">
            {packageData?.name}{" "}
            <small>by {packageData?.publisher?.["display-name"]}</small>
          </h1>
        )}
      </div>
    </section>
  );
}
 
export default SectionHeader;