UNPKG

@shopify/polaris

Version:

Shopify’s product component library

19 lines (18 loc) 623 B
import * as tslib_1 from "tslib"; import React from 'react'; import { Button } from './Button'; export function buttonsFrom(actions, overrides = {}) { if (Array.isArray(actions)) { return actions.map((action, index) => buttonFrom(action, overrides, index)); } else { const action = actions; return buttonFrom(action, overrides); } } export function buttonFrom(_a, overrides, key) { var { content, onAction } = _a, action = tslib_1.__rest(_a, ["content", "onAction"]); return (<Button key={key} onClick={onAction} {...action} {...overrides}> {content} </Button>); }