All files / interfaces/components/CanonicalRelationsMeta CanonicalRelationsMeta.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 26 27 28 29                  4x   4x                                  
import { Button } from "@canonical/react-components";
 
type Props = {
  interfaceName: string | undefined;
  interfaceVersion: string;
};
 
function CanonicalRelationsMeta({ interfaceName, interfaceVersion }: Props) {
  // Fallback URL if interfaceName is undefined
  const url = `https://github.com/canonical/charm-relation-interfaces/blob/main/interfaces/${interfaceName ? interfaceName + "/" : ""}v${interfaceVersion}/README.md`;
 
  return (
    <>
      <h2 className="p-muted-heading">Help us improve this page</h2>
      <p>
        Most of this content can be collaboratively discussed and changed in the
        respective README file.
      </p>
      <p>
        <Button element="a" href={url} appearance="positive">
          Contribute
        </Button>
      </p>
    </>
  );
}
 
export default CanonicalRelationsMeta;