@shakthillc/components
Version:
React generic components for shakthi products
48 lines (44 loc) • 1.23 kB
JavaScript
import React from 'react';
import style from "./InlineAlert.module.css";
import { PropTypes } from 'prop-types';
import Icon from '@material-ui/core/Icon';
var InlineAlert = function InlineAlert(_ref) {
var w = _ref.width,
h = _ref.height,
icon = _ref.icon,
color = _ref.color,
text = _ref.text,
display = _ref.display;
if (!display) var dispProp = "none";
return React.createElement(
'div',
{ style: { width: w, height: h, backgroundColor: color, display: dispProp }, className: style['Inline-container'] },
React.createElement(
Icon,
null,
icon
),
React.createElement(
'div',
{ className: style['Inline-container--text'] },
text
)
);
};
export default InlineAlert;
InlineAlert.defaultProps = {
height: "32px",
width: "432px",
color: "#FFD4D1",
display: true,
icon: "report_problem",
text: "This is a sample Inline alert"
};
InlineAlert.propTypes = {
icon: PropTypes.string,
color: PropTypes.string,
width: PropTypes.string,
height: PropTypes.string,
text: PropTypes.string,
display: PropTypes.bool
};