UNPKG

@shopify/polaris

Version:

Shopify’s product component library

30 lines (25 loc) 665 B
import React$1 from 'react'; import { AlertMinor } from '@shopify/polaris-icons'; import { Icon as Icon$1 } from '../Icon/Icon.js'; import styles from './InlineError.scss.js'; var _ref = /*#__PURE__*/React$1.createElement(Icon$1, { source: AlertMinor }); function InlineError({ message, fieldID }) { if (!message) { return null; } return /*#__PURE__*/React$1.createElement("div", { id: errorTextID(fieldID), className: styles.InlineError }, /*#__PURE__*/React$1.createElement("div", { className: styles.Icon }, _ref), message); } function errorTextID(id) { return "".concat(id, "Error"); } export { InlineError, errorTextID };