UNPKG

@redocly/theme

Version:

Shared UI components lib

23 lines 2.55 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.CatalogEntityRelationsTableContent = CatalogEntityRelationsTableContent; const react_1 = __importDefault(require("react")); const styled_components_1 = __importDefault(require("styled-components")); const ArrowDownIcon_1 = require("../../../../icons/ArrowDownIcon/ArrowDownIcon"); const LoadMore_1 = require("../../../../components/LoadMore/LoadMore"); const CatalogTableView_1 = require("../../../../components/Catalog/CatalogTableView/CatalogTableView"); const CatalogHighlight_1 = require("../../../../components/Catalog/CatalogHighlight"); const CatalogEntitiesEmptyState_1 = require("../../../../components/Catalog/CatalogEntitiesEmptyState"); function CatalogEntityRelationsTableContent({ entitiesCatalogConfig, catalogConfig, relations, query, searchQuery, columns, setSortOption, sortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, listType, onRowClick, }) { return (react_1.default.createElement(TableContentWrapper, { "data-component-name": "Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTableContent" }, react_1.default.createElement(CatalogHighlight_1.HighlightContext.Provider, { value: [searchQuery] }, relations.length > 0 ? (react_1.default.createElement(CatalogTableView_1.CatalogTableView, { entities: relations, entitiesCatalogConfig: entitiesCatalogConfig, catalogConfig: catalogConfig, columns: columns, setSortOption: setSortOption, currentSortOption: sortOption, handleSortClick: handleSortClick, isColumnSorted: isColumnSorted, style: { marginTop: 0 }, onRowClick: onRowClick, contentMinWidth: TABLE_SCROLL_MIN_WIDTH_PX })) : (react_1.default.createElement(CatalogEntitiesEmptyState_1.CatalogEntitiesEmptyState, { listType: listType }))), shouldShowLoadMore && (react_1.default.createElement(LoadMore_1.LoadMore, { icon: react_1.default.createElement(ArrowDownIcon_1.ArrowDownIcon, { size: "var(--catalog-load-more-icon-size)" }), onClick: query.fetchNextPage, disabled: query.isFetchingNextPage, blinking: query.isFetchingNextPage, label: query.isFetchingNextPage ? 'Loading...' : 'Load More' })))); } const TABLE_SCROLL_MIN_WIDTH_PX = 608; const TableContentWrapper = styled_components_1.default.div ` min-width: 0; /* Constrain width so table overflow-x scroll works inside tabs */ `; //# sourceMappingURL=CatalogEntityRelationsTableContent.js.map