import React, { JSX } from 'react'; import type { CatalogEntityConfig, EntitiesCatalogConfig } from '@redocly/config'; import type { ListType } from '@redocly/theme/core/types'; import type { BffCatalogEntity, BffCatalogRelatedEntity } from '@redocly/theme/core/types'; import { CatalogColumn } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogTableView'; import { CatalogEntityCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityCell'; import { CatalogEntityRelationsTable } from '@redocly/theme/components/Catalog/CatalogEntity/CatalogEntityRelations/CatalogEntityRelationsTable'; import { CatalogEntityTypeTag } from '@redocly/theme/components/Catalog/CatalogEntityTypeTag'; import { CatalogEntityRelationCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogEntityRelationCell'; import { CatalogLastUpdateCell } from '@redocly/theme/components/Catalog/CatalogTableView/CatalogLastUpdateCell'; export type CatalogEntityDefaultRelationsProps = { entity: BffCatalogEntity; entitiesCatalogConfig: EntitiesCatalogConfig; catalogConfig: CatalogEntityConfig; relations: BffCatalogRelatedEntity[]; query: { fetchNextPage: () => void; isFetchingNextPage: boolean; }; searchQuery: string; setSearchQuery: (query: string) => void; sortOption: string | null; setSortOption: (sortOption: string | null) => void; handleSortClick: (sortKey: string, direction: 'asc' | 'desc') => void; isColumnSorted: (sortKey: string, direction: 'asc' | 'desc') => boolean; shouldShowLoadMore: boolean; shouldShowHeading?: boolean; listType?: ListType; }; export function CatalogEntityDefaultRelations({ entity, relations, query, searchQuery, setSearchQuery, entitiesCatalogConfig, catalogConfig, sortOption, setSortOption, handleSortClick, isColumnSorted, shouldShowLoadMore, shouldShowHeading = true, listType, }: CatalogEntityDefaultRelationsProps): JSX.Element { return (