@shopify/polaris
Version:
Shopify’s product component library
22 lines (19 loc) • 567 B
JavaScript
import React$1 from 'react';
import { buttonFrom } from '../Button/utils.js';
import { Card as Card$1 } from '../Card/Card.js';
import { SettingAction as SettingAction$1 } from '../SettingAction/SettingAction.js';
function SettingToggle({
enabled,
action,
children
}) {
var actionMarkup = action ? buttonFrom(action, {
primary: !enabled
}) : null;
return /*#__PURE__*/React$1.createElement(Card$1, {
sectioned: true
}, /*#__PURE__*/React$1.createElement(SettingAction$1, {
action: actionMarkup
}, children));
}
export { SettingToggle };