UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

63 lines (62 loc) 1.61 kB
import React, { Component } from 'react'; import { AlertIcons_defaultProps } from "./props/defaultProps"; import { AlertIcons_propTypes } from "./props/propTypes"; import DangerAlertIcon from "./DangerAlertIcon"; import SuccessAlertIcon from "./SuccessAlertIcon"; import WarningAlertIcon from "./WarningAlertIcon"; import InfoAlertIcon from "./InfoAlertIcon"; import NotificationAlertIcon from "./NotificationAlertIcon"; import AlarmAlertIcon from "./AlarmAlertIcon"; import style from "./AlertIcons.module.css"; let alertIconsObject = { success: { AlertIcon: SuccessAlertIcon }, error: { AlertIcon: DangerAlertIcon }, danger: { AlertIcon: DangerAlertIcon }, warning: { AlertIcon: WarningAlertIcon }, info: { AlertIcon: InfoAlertIcon }, notification: { AlertIcon: NotificationAlertIcon }, alarm: { AlertIcon: AlarmAlertIcon }, primary: { AlertIcon: InfoAlertIcon } }; export default class AlertIcons extends Component { render() { let { type, variant, dataSelectorId } = this.props; let { AlertIcon = DangerAlertIcon } = alertIconsObject[type] || {}; return /*#__PURE__*/React.createElement("div", { className: style.iconContainer, "data-selector-id": dataSelectorId }, /*#__PURE__*/React.createElement(AlertIcon, { variant: variant, type: type })); } } AlertIcons.propTypes = AlertIcons_propTypes; AlertIcons.defaultProps = AlertIcons_defaultProps; // if (__DOCS__) { // AlertIcons.docs = { // componentGroup: 'AlertIcons', // folderName: 'Alert' // }; // }