UNPKG

@redocly/theme

Version:

Shared UI components lib

26 lines 1.78 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GitProperty = GitProperty; const react_1 = __importDefault(require("react")); const GithubIcon_1 = require("../../../../icons/GithubIcon/GithubIcon"); const utils_1 = require("../../../../core/utils"); const Tag_1 = require("../../../../components/Tag/Tag"); const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard"); const hooks_1 = require("../../../../core/hooks"); function GitProperty({ entity }) { const { useTranslate } = (0, hooks_1.useThemeHooks)(); const { translate } = useTranslate(); const git = entity.git; return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/GitProperty" }, react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(GithubIcon_1.GithubIcon, null), translate('catalog.repositories.label', 'Repositories')), content: react_1.default.createElement(react_1.default.Fragment, null, git === null || git === void 0 ? void 0 : git.map((repo) => { const url = new URL(repo); const repoName = (0, utils_1.removeLeadingSlash)(url.pathname); return (react_1.default.createElement(Tag_1.Tag, { key: repo, textTransform: "none", style: { backgroundColor: 'var(--bg-color)' } }, repoName)); })) }))); } //# sourceMappingURL=GitProperty.js.map