Merge branch '13894-default-view-component'
[arvados-workbench2.git] / src / views-components / details-panel / project-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 { ProjectIcon } from '../../components/icon/icon';
7 import { ProjectResource } from '../../models/project';
8 import { formatDate } from '../../common/formatters';
9 import { ResourceKind } from '../../models/resource';
10 import { resourceLabel } from '../../common/labels';
11 import { DetailsData } from "./details-data";
12 import { DetailsAttribute } from "../../components/details-attribute/details-attribute";
13
14 export class ProjectDetails extends DetailsData<ProjectResource> {
15
16     getIcon(className?: string) {
17         return <ProjectIcon className={className} />;
18     }
19
20     getDetails() {
21         return <div>
22             <DetailsAttribute label='Type' value={resourceLabel(ResourceKind.PROJECT)} />
23             {/* Missing attr */}
24             <DetailsAttribute label='Size' value='---' />
25             <DetailsAttribute label='Owner' value={this.item.ownerUuid} />
26             <DetailsAttribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
27             <DetailsAttribute label='Created at' value={formatDate(this.item.createdAt)} />
28             {/* Missing attr */}
29             <DetailsAttribute label='File size' value='1.4 GB' />
30             <DetailsAttribute label='Description' value={this.item.description} />
31         </div>;
32     }
33 }