cf77aaf14e2c84ba6be3f749c004eb83532ae24f
[arvados-workbench2.git] / src / views / project-panel / project-panel-item.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { Resource } from "../../common/api/common-resource-service";
6 import { DataItem } from "../../components/data-table/data-table";
7
8 export interface ProjectPanelItem extends DataItem {
9     uuid: string;
10     name: string;
11     kind: string;
12     url: string;
13     owner: string;
14     lastModified: string;
15     fileSize?: number;
16     status?: string;
17 }
18
19 export function resourceToDataItem(r: Resource): ProjectPanelItem {
20     return {
21         key: r.uuid,
22         uuid: r.uuid,
23         name: r.uuid,
24         kind: r.kind,
25         url: "",
26         owner: r.ownerUuid,
27         lastModified: r.modifiedAt
28     };
29 }
30