1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { CollectionIcon } from '~/components/icon/icon';
7 import { CollectionResource } from '~/models/collection';
8 import { formatDate, formatFileSize } from '~/common/formatters';
9 import { resourceLabel } from '~/common/labels';
10 import { ResourceKind } from '~/models/resource';
11 import { DetailsData } from "./details-data";
12 import { DetailsAttribute } from "~/components/details-attribute/details-attribute";
14 export class CollectionDetails extends DetailsData<CollectionResource> {
16 getIcon(className?: string) {
17 return <CollectionIcon className={className} />;
22 <DetailsAttribute label='Type' value={resourceLabel(ResourceKind.COLLECTION)} />
23 <DetailsAttribute label='Size' value='---' />
24 <DetailsAttribute label='Owner' linkToUuid={this.item.ownerUuid} lowercaseValue={true} />
25 <DetailsAttribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
26 <DetailsAttribute label='Created at' value={formatDate(this.item.createdAt)} />
27 <DetailsAttribute label='Collection UUID' linkToUuid={this.item.uuid} value={this.item.uuid} />
28 <DetailsAttribute label='Content address' linkToUuid={this.item.portableDataHash} value={this.item.portableDataHash} />
30 <DetailsAttribute label='Number of files' value={this.item.fileCount} />
31 <DetailsAttribute label='Content size' value={formatFileSize(this.item.fileSizeTotal)} />