UNPKG

wix-style-react

Version:
29 lines 1.97 kB
import React from 'react'; import Button from '../Button'; import { st, classes } from './MessageBoxFunctionalLayout.st.css'; import { dataHooks } from './constants'; const buttonSkinByTheme = { blue: 'standard', purple: 'premium', red: 'destructive', }; const buttonSizeByHeight = { 'x-small': 'tiny', tiny: 'tiny', small: 'small', medium: 'medium', large: 'large', 'x-large': 'large', }; const Footer = ({ bottomChildren, children, theme = 'blue', cancelText, cancelPrefixIcon, cancelSuffixIcon, onCancel, onOk, confirmText, confirmPrefixIcon, confirmSuffixIcon, buttonsHeight = 'small', enableOk = true, enableCancel = true, sideActions, newColorsBranding, }) => (React.createElement(React.Fragment, null, React.createElement("div", { className: st(classes.footer, { newColorsBranding }), "data-hook": dataHooks.footer }, sideActions, children, React.createElement("div", { className: st(classes.footerbuttons, { withSideActions: sideActions && (cancelText || confirmText), }) }, cancelText && (React.createElement(Button, { prefixIcon: cancelPrefixIcon, suffixIcon: cancelSuffixIcon, disabled: !enableCancel, size: buttonSizeByHeight[buttonsHeight], priority: "secondary", skin: buttonSkinByTheme[theme], onClick: onCancel, dataHook: dataHooks.footerCancelButton, children: cancelText })), confirmText && (React.createElement(Button, { prefixIcon: confirmPrefixIcon, suffixIcon: confirmSuffixIcon, disabled: !enableOk, size: buttonSizeByHeight[buttonsHeight], priority: "primary", skin: buttonSkinByTheme[theme], onClick: onOk, dataHook: dataHooks.footerConfirmButton, children: confirmText })))), bottomChildren && (React.createElement("div", { "data-hook": dataHooks.footerBelowChildren, className: st(classes.bottomChildren, { newColorsBranding }), children: bottomChildren })))); export default Footer; //# sourceMappingURL=FooterLayout.js.map