import { Link } from 'react-router-dom'; import { Flex } from '@patternfly/react-core'; import { COMPONENT_DETAILS_V2_PATH, COMPONENT_VERSIONS_PATH } from '@routes/paths'; import GitRepoLink from '~/components/GitLink/GitRepoLink'; import LatestPushBuildSection from '~/components/LatestBuild/LatestPushBuildSection'; import { defineFilters } from '~/shared/components/Filter'; import { ColumnDefinition } from '~/shared/components/TableV2'; import { ComponentKind } from '~/types'; import { textMatch } from '~/utils/text-filter-utils'; export const componentsFilterConfig = defineFilters()([ { type: 'search', param: 'name', label: 'Name', mode: 'client', filterFn: (item, value) => textMatch(item.metadata.name ?? '', value), }, ]); export const componentsTableColumns: ColumnDefinition[] = [ { id: 'component', header: 'Component', accessorFn: (row) => row.metadata.name ?? '-', sortable: true, size: 2, nonHidable: true, cell: (info) => { const component = info.row.original; const versions = component.spec.source?.versions ?? []; return ( {component.metadata.name} {component.spec.source?.url && ( )} ); }, }, { id: 'versions', header: 'Versions', sortable: true, accessorFn: (row) => row.spec.source?.versions?.length ?? 0, cell: (info) => { const component = info.row.original; return ( {component.spec.source?.versions?.length ?? 0} ); }, }, { id: 'latest-build', header: 'Latest build', sortable: false, size: 4, cell: (info) => , }, // TODO: add build logs modal + actions ];