Restric order and filters arguments of favorite list
[arvados-workbench2.git] / src / components / details-panel-factory / items / collection-item.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 '../../icon/icon';
7 import Attribute from '../../attribute/attribute';
8 import AbstractItem from './abstract-item';
9 import { CollectionResource } from '../../../models/collection';
10 import { formatDate } from '../../../common/formatters';
11 import { resourceLabel } from '../../../common/labels';
12 import { ResourceKind } from '../../../models/resource';
13
14 export default class CollectionItem extends AbstractItem<CollectionResource> {
15
16     getIcon(className?: string) {
17         return <CollectionIcon className={className} />;
18     }
19
20     buildDetails() {
21         return <div>
22             <Attribute label='Type' value={resourceLabel(ResourceKind.Collection)} />
23             <Attribute label='Size' value='---' />
24             <Attribute label='Owner' value={this.item.ownerUuid} />
25             <Attribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
26             <Attribute label='Created at' value={formatDate(this.item.createdAt)} />
27             {/* Links but we dont have view */}
28             <Attribute label='Collection UUID' link={this.item.uuid} value={this.item.uuid} />
29             <Attribute label='Content address' link={this.item.portableDataHash} value={this.item.portableDataHash} />
30             {/* Missing attrs */}
31             <Attribute label='Number of files' value='20' />
32             <Attribute label='Content size' value='54 MB' />
33         </div>;
34     }
35 }