UNPKG

@redocly/theme

Version:

Shared UI components lib

26 lines 1.91 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ContactProperty = ContactProperty; const react_1 = __importDefault(require("react")); const SlackIcon_1 = require("../../../../icons/SlackIcon/SlackIcon"); const Tag_1 = require("../../../../components/Tag/Tag"); const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard"); const hooks_1 = require("../../../../core/hooks"); function ContactProperty({ entity }) { var _a, _b; const { useTranslate } = (0, hooks_1.useThemeHooks)(); const { translate } = useTranslate(); const channels = (_b = (_a = entity.contact) === null || _a === void 0 ? void 0 : _a.slack) === null || _b === void 0 ? void 0 : _b.channels; return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/ContactProperty" }, react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(SlackIcon_1.SlackIcon, null), translate('catalog.contact.label', 'Slack channels')), content: react_1.default.createElement(react_1.default.Fragment, null, channels === null || channels === void 0 ? void 0 : channels.map((channel) => (react_1.default.createElement(Tag_1.Tag, { key: channel.name, textTransform: "none", style: { backgroundColor: 'var(--bg-color)', cursor: 'pointer' }, onClick: () => { if (channel.url) { window.open(channel.url, '_blank'); } } }, channel.name)))) }))); } //# sourceMappingURL=ContactProperty.js.map