UNPKG

@uiw/react-shields

Version:

Shields.io for react component, Quality metadata badges for open source projects.

26 lines 932 B
import _extends from "@babel/runtime/helpers/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose"; var _excluded = ["platform", "base", "projectId", "branch"]; import React from 'react'; import { Internal } from '../common/Base'; import { jsx as _jsx } from "react/jsx-runtime"; var Codacy = /*#__PURE__*/React.forwardRef((props, ref) => { var { platform = 'coveralls', base = 'https://img.shields.io', projectId, branch } = props, other = _objectWithoutPropertiesLoose(props, _excluded); var getUrl = () => { if (platform !== 'coveralls') return ''; if (branch) return [base, platform, projectId, branch].join('/'); return [base, 'codacy/coverage', projectId].join('/'); }; return /*#__PURE__*/_jsx(Internal, _extends({ imgSrc: getUrl(), ref: ref }, other)); }); Codacy.displayName = 'Codacy'; export default Codacy;