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 } from '@mui/styles';
8 import withStyles from '@mui/styles/withStyles';
9 import { ArvadosTheme } from '../../common/custom-theme';
10 import { Typography } from '@mui/material';
11 import { IconType } from '../icon/icon';
12 import classnames from "classnames";
14 type CssRules = 'root' | 'icon' | 'message';
16 const styles: CustomStyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
21 color: theme.palette.grey["500"],
25 color: theme.palette.grey["500"]
29 export interface DefaultViewDataProps {
32 filtersApplied?: boolean;
33 classMessage?: string;
38 type DefaultViewProps = DefaultViewDataProps & WithStyles<CssRules>;
40 export const DefaultView = withStyles(styles)(
41 ({ classes, classRoot, messages, classMessage, icon: Icon, classIcon }: DefaultViewProps) =>
42 <Typography className={classnames([classes.root, classRoot])} component="div">
43 {Icon && <Icon className={classnames([classes.icon, classIcon])} />}
44 {messages.map((msg: string, index: number) => {
45 return <Typography key={index}
46 data-cy='default-view'
47 className={classnames([classes.message, classMessage])}>{msg}</Typography>;