2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt odlux
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
18 import React from 'react';
20 import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons'; // select app icon
21 import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
22 import Typography from '@mui/material/Typography';
23 import { WithStyles } from '@mui/styles';
24 import createStyles from '@mui/styles/createStyles';
25 import withStyles from '@mui/styles/withStyles';
26 import Tooltip from '@mui/material/Tooltip';
28 import { connect, Connect } from '../../../../framework/src/flux/connect';
29 import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore';
32 const styles = () => createStyles({
51 const mapProps = (state: IApplicationStoreState) => ({
52 faultStatus: state.fault.faultStatus,
56 type FaultStatusComponentProps = & WithStyles<typeof styles> & Connect<typeof mapProps>;
58 class FaultStatusComponent extends React.Component<FaultStatusComponentProps> {
59 render(): JSX.Element {
60 const { classes, faultStatus } = this.props;
64 <Typography variant="body1" color="inherit">
66 <Tooltip title="Critical Alarms" arrow>
67 <span aria-label="critical-alarms">
68 <FontAwesomeIcon className={`${classes.icon} ${classes.critical}`} icon={faExclamationTriangle} />
71 {faultStatus.critical} |
74 <Typography variant="body1" color="inherit">
75 <Tooltip title="Major Alarms" arrow>
76 <span aria-label="major-alarms">
77 <FontAwesomeIcon className={`${classes.icon} ${classes.major}`} icon={faExclamationTriangle} />
83 <Typography variant="body1" color="inherit">
84 <Tooltip title="Minor Alarms" arrow>
85 <span aria-label="minor-alarms">
86 <FontAwesomeIcon className={`${classes.icon} ${classes.minor}`} icon={faExclamationTriangle} />
92 <Typography variant="body1" color="inherit">
93 <Tooltip title="Warning Alarms" arrow>
94 <span aria-label="warning-alarms">
95 <FontAwesomeIcon className={`${classes.icon} ${classes.warning}`} icon={faExclamationTriangle} />
98 {faultStatus.warning} |
105 export const FaultStatus = withStyles(styles)(connect(mapProps)(FaultStatusComponent));
106 export default FaultStatus;