2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 import React, {Component} from 'react';
22 import { PropTypes } from 'prop-types';
23 import FontAwesome from 'react-fontawesome';
24 import InlineMessageConstatns from './InlineMessageConstants';
26 import Alert from 'react-bootstrap/lib/Alert';
28 export default class InlineMessage extends Component {
31 level: PropTypes.string,
32 messageTxt: PropTypes.string
35 static defaultProps = {
41 let {level, messageTxt} = this.props;
42 let fontawesomeClassName;
43 //Select the font based on the severity level
46 fontawesomeClassName = InlineMessageConstatns.SUCCESS_CLASSNAME;
49 fontawesomeClassName = InlineMessageConstatns.WARNING_CLASSNAME;
52 fontawesomeClassName = InlineMessageConstatns.DANGER_CLASSNAME;
55 fontawesomeClassName = InlineMessageConstatns.DEFAULT_CLASSNAME;
60 if (messageTxt && messageTxt.length > 0) {
62 <Alert bsStyle={level}
63 className={InlineMessageConstatns.ALERT_PANEL_CLASSNAME}>
64 <div className={InlineMessageConstatns.NOTIFICATION_PANEL_CLASSNAME}>
65 <div className={InlineMessageConstatns.ICON_PANEL_CLASSNAME}>
66 <FontAwesome className={fontawesomeClassName}
67 name={fontawesomeClassName}/>
69 <div className={InlineMessageConstatns.MESSAGE_PANEL_CLASSNAME}>