1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as 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 * as 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 classMessage?: string;
35 type DefaultViewProps = DefaultViewDataProps & WithStyles<CssRules>;
37 export const DefaultView = withStyles(styles)(
38 ({ classes, classRoot, messages, classMessage, icon: Icon, classIcon }: DefaultViewProps) =>
39 <Typography className={classnames([classes.root, classRoot])} component="div">
40 <Icon className={classnames([classes.icon, classIcon])} />
41 {messages.map((msg: string, index: number) => {
42 return <Typography key={index} variant="body1"
43 className={classnames([classes.message, classMessage])}>{msg}</Typography>;