13493: Merge branch 'master' into 13494-collection-version-browser
[arvados-workbench2.git] / src / views-components / details-panel / collection-details.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { CollectionIcon } from '~/components/icon/icon';
7 import { CollectionResource } from '~/models/collection';
8 import { DetailsData } from "./details-data";
9 import { CollectionDetailsAttributes } from '~/views/collection-panel/collection-panel';
10
11 export class CollectionDetails extends DetailsData<CollectionResource> {
12
13     getIcon(className?: string) {
14         return <CollectionIcon className={className} />;
15     }
16
17     getTabLabels() {
18         return ['Details', 'Versions'];
19     }
20
21     getDetails(tabNumber: number) {
22         switch (tabNumber) {
23             case 0:
24                 return this.getCollectionInfo();
25             case 1:
26                 return this.getVersionBrowser();
27             default:
28                 return <div />;
29         }
30     }
31
32     private getCollectionInfo() {
33         return <CollectionDetailsAttributes twoCol={false} item={this.item} />;
34     }
35
36     private getVersionBrowser() {
37         return <div />;
38     }
39 }