// Copyright (C) The Arvados Authors. All rights reserved. // // SPDX-License-Identifier: AGPL-3.0 import * as React from 'react'; import { Grid, Typography } from '@material-ui/core'; import { FavoriteStar } from '../favorite-star/favorite-star'; import { ResourceKind } from '~/models/resource'; import { ProjectIcon, CollectionIcon, ProcessIcon, DefaultIcon } from '~/components/icon/icon'; import { formatDate, formatFileSize } from '~/common/formatters'; import { resourceLabel } from '~/common/labels'; export const renderName = (item: {name: string; uuid: string, kind: string}) => {renderIcon(item)} {item.name} ; export const renderIcon = (item: {kind: string}) => { switch (item.kind) { case ResourceKind.PROJECT: return ; case ResourceKind.COLLECTION: return ; case ResourceKind.PROCESS: return ; default: return ; } }; export const renderDate = (date: string) => { return {formatDate(date)}; }; export const renderFileSize = (fileSize?: number) => {formatFileSize(fileSize)} ; export const renderOwner = (owner: string) => {owner} ; export const renderType = (type: string) => {resourceLabel(type)} ; export const renderStatus = (item: {status?: string}) => {item.status || "-"} ;