@shopify/polaris
Version:
Shopify’s product component library
27 lines (23 loc) • 786 B
JavaScript
import { objectWithoutProperties as _objectWithoutProperties } from '../../_virtual/_rollupPluginBabelHelpers.js';
import React$1 from 'react';
import { Button as Button$1 } from './Button.js';
function buttonsFrom(actions, overrides = {}) {
if (Array.isArray(actions)) {
return actions.map((action, index) => buttonFrom(action, overrides, index));
} else {
var _action = actions;
return buttonFrom(_action, overrides);
}
}
function buttonFrom(_ref, overrides, key) {
var {
content,
onAction
} = _ref,
action = _objectWithoutProperties(_ref, ["content", "onAction"]);
return /*#__PURE__*/React$1.createElement(Button$1, Object.assign({
key: key,
onClick: onAction
}, action, overrides), content);
}
export { buttonFrom, buttonsFrom };