UNPKG

@atlaskit/comment

Version:

A comment displays discussions and user feedback.

50 lines • 1.72 kB
/* footer.tsx generated by @compiled/babel-plugin v3.0.2 */ import "./footer.compiled.css"; import { ax, ix } from "@compiled/react/runtime"; import React from 'react'; import WarningIcon from '@atlaskit/icon/core/status-warning'; import { Flex } from '@atlaskit/primitives/compiled'; // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- TODO: migrate to @atlaskit/primitives/compiled import Inline from '@atlaskit/primitives/inline'; var iconSpacingStyles = { space050: "_1rjc1b66 _18zr1b66" }; /** * __Footer items__ * * The footer items in the comment. Usually reserved for error messages. * * @internal */ var Footer = function Footer(_ref) { var _ref$actions = _ref.actions, actions = _ref$actions === void 0 ? [] : _ref$actions, _ref$errorActions = _ref.errorActions, errorActions = _ref$errorActions === void 0 ? [] : _ref$errorActions, errorIconLabel = _ref.errorIconLabel, isError = _ref.isError, isSaving = _ref.isSaving, testId = _ref.testId; if (isSaving || !(actions.length || errorActions.length)) { return null; } var items = isError ? errorActions : actions; return /*#__PURE__*/React.createElement(Inline, { alignBlock: "center", shouldWrap: true, testId: testId, space: "space.100", separator: "\xB7" }, isError && /*#__PURE__*/React.createElement(Flex, { xcss: iconSpacingStyles.space050 }, /*#__PURE__*/React.createElement(WarningIcon, { color: "var(--ds-icon-warning, #E06C00)", label: errorIconLabel ? errorIconLabel : '' })), items.map(function (item, key) { return Object.assign({}, item, { key: key }); })); }; Footer.displayName = 'CommentFooter'; export default Footer;