1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import * as classnames from "classnames";
7 import CloseAnnouncement from '@material-ui/icons/Announcement';
8 import CloseIcon from '@material-ui/icons/Close';
9 import FolderIcon from '@material-ui/icons/Folder';
11 export enum IconTypes {
12 ANNOUNCEMENT = 'announcement',
16 COLLECTION = 'collection',
20 interface IconBaseDataProps {
25 type IconBaseProps = IconBaseDataProps;
27 interface IconBaseState {
31 const getSpecificIcon = (props: any) => ({
32 announcement: <CloseAnnouncement className={props.className} />,
33 folder: <FolderIcon className={props.className} />,
34 close: <CloseIcon className={props.className} />,
35 project: <i className={classnames([props.className, 'fas fa-folder fa-lg'])} />,
36 collection: <i className={classnames([props.className, 'fas fa-archive fa-lg'])} />,
37 process: <i className={classnames([props.className, 'fas fa-cogs fa-lg'])} />
40 class IconBase extends React.Component<IconBaseProps, IconBaseState> {
42 icon: IconTypes.FOLDER,
46 return getSpecificIcon(this.props)[this.props.icon];
50 export default IconBase;