@shopify/polaris
Version:
Shopify’s product component library
25 lines (22 loc) • 914 B
JavaScript
import React$1 from 'react';
import { buttonsFrom } from '../Button/utils.js';
import { ButtonGroup as ButtonGroup$1 } from '../ButtonGroup/ButtonGroup.js';
import { Stack as Stack$1 } from '../Stack/Stack.js';
import styles from './PageActions.scss.js';
function PageActions({
primaryAction,
secondaryActions
}) {
var primaryActionMarkup = primaryAction ? buttonsFrom(primaryAction, {
primary: true
}) : null;
var secondaryActionsMarkup = secondaryActions ? /*#__PURE__*/React$1.createElement(ButtonGroup$1, null, buttonsFrom(secondaryActions)) : null;
var distribution = secondaryActionsMarkup ? 'equalSpacing' : 'trailing';
return /*#__PURE__*/React$1.createElement("div", {
className: styles.PageActions
}, /*#__PURE__*/React$1.createElement(Stack$1, {
distribution: distribution,
spacing: "tight"
}, secondaryActionsMarkup, primaryActionMarkup));
}
export { PageActions };