1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { CustomStyleRulesCallback } from 'common/custom-theme';
7 import { WithStyles, withStyles } from '@material-ui/core/styles';
8 import { ArvadosTheme } from '../../common/custom-theme';
9 import { Typography } from '@material-ui/core';
10 import { IconType } from '../icon/icon';
11 import classnames from "classnames";
13 type CssRules = 'root' | 'icon' | 'message';
15 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
20 color: theme.palette.grey["500"],
24 color: theme.palette.grey["500"]
28 export interface DefaultViewDataProps {
31 filtersApplied?: boolean;
32 classMessage?: string;
37 type DefaultViewProps = DefaultViewDataProps & WithStyles<CssRules>;
39 export const DefaultView = withStyles(styles)(
40 ({ classes, classRoot, messages, classMessage, icon: Icon, classIcon }: DefaultViewProps) =>
41 <Typography className={classnames([classes.root, classRoot])} component="div">
42 {Icon && <Icon className={classnames([classes.icon, classIcon])} />}
43 {messages.map((msg: string, index: number) => {
44 return <Typography key={index}
45 data-cy='default-view'
46 className={classnames([classes.message, classMessage])}>{msg}</Typography>;