forked from talamer/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReppositoryList.tsx
33 lines (30 loc) · 1.06 KB
/
ReppositoryList.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as React from 'react';
import { Table } from '@console/internal/components/factory';
import { RepositoryModel } from '../../../models';
import { usePipelineRuns } from '../../pipelineruns/hooks/usePipelineRuns';
import { useTaskRuns } from '../../pipelineruns/hooks/useTaskRuns';
import { RepositoryKind } from '../types';
import RepositoryHeader from './RepositoryHeader';
import RepositoryRow from './RepositoryRow';
export interface RepositoryListProps {
data?: RepositoryKind[];
namespace: string;
}
const RepositoryList: React.FC<RepositoryListProps> = (props) => {
const [taskRuns, taskRunsLoaded] = useTaskRuns(props.namespace);
const [pipelineRuns, pipelineRunsLoaded] = usePipelineRuns(props.namespace);
return (
<Table
{...props}
aria-label={RepositoryModel.labelPluralKey}
Header={RepositoryHeader}
Row={RepositoryRow}
customData={{
taskRuns: taskRunsLoaded ? taskRuns : [],
pipelineRuns: pipelineRunsLoaded ? pipelineRuns : [],
}}
virtualize
/>
);
};
export default RepositoryList;