UNPKG

@redocly/theme

Version:

Shared UI components lib

23 lines 1.99 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.DomainsProperty = DomainsProperty; const react_1 = __importDefault(require("react")); const GraphIcon_1 = require("../../../../icons/GraphIcon/GraphIcon"); const CatalogEntityPropertyCard_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityProperties/CatalogEntityPropertyCard"); const hooks_1 = require("../../../../core/hooks"); const Button_1 = require("../../../../components/Button/Button"); function DomainsProperty({ entity }) { const { useTranslate, usePageProps } = (0, hooks_1.useThemeHooks)(); const { entitiesCatalogConfig } = usePageProps(); const { getEntityLink } = (0, hooks_1.useCatalogEntityLink)(entitiesCatalogConfig); const { translate } = useTranslate(); const { domains = [] } = entity; return (react_1.default.createElement("div", { "data-component-name": "Catalog/CatalogEntity/CatalogEntityProperties/DomainsProperty" }, react_1.default.createElement(CatalogEntityPropertyCard_1.CatalogEntityPropertyCard, { header: react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(GraphIcon_1.GraphIcon, null), translate('catalog.domains.label', 'Domains')), content: react_1.default.createElement(react_1.default.Fragment, null, domains === null || domains === void 0 ? void 0 : domains.map((domain) => (react_1.default.createElement(Button_1.Button, { key: domain === null || domain === void 0 ? void 0 : domain.id, variant: "outlined", size: "small", style: { backgroundColor: 'var(--bg-color)' }, to: getEntityLink(domain), icon: react_1.default.createElement(GraphIcon_1.GraphIcon, null), external: true }, domain === null || domain === void 0 ? void 0 : domain.title)))) }))); } //# sourceMappingURL=DomainsProperty.js.map