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