@elastic/eui
Version:
Elastic UI Component Library
39 lines (38 loc) • 1.64 kB
JavaScript
;
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.EuiToastAction = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _button = require("../button");
var _react2 = require("@emotion/react");
var _excluded = ["children", "actionType", "color"];
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
var EuiToastAction = exports.EuiToastAction = function EuiToastAction(_ref) {
var children = _ref.children,
_ref$actionType = _ref.actionType,
actionType = _ref$actionType === void 0 ? 'primary' : _ref$actionType,
_ref$color = _ref.color,
color = _ref$color === void 0 ? 'primary' : _ref$color,
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
if (actionType === 'primary') {
return (0, _react2.jsx)(_button.EuiButton, (0, _extends2.default)({
size: "s",
color: color
}, rest), children);
} else {
return (0, _react2.jsx)(_button.EuiButtonEmpty, (0, _extends2.default)({
size: "s",
color: color
}, rest), children);
}
};