UNPKG

wix-style-react

Version:
28 lines 1.12 kB
import React from 'react'; import PropTypes from 'prop-types'; import Button from '../../Button'; import TextButton from '../../TextButton'; import { dataHooks } from '../constants'; import { classes } from '../Notification.st.css'; const ActionButton = ({ children, onClick, type = 'button', link, target = '_self', }) => { const commonProps = { dataHook: dataHooks.notificationCtaButton, onClick, }; if (type === 'textLink') { return (React.createElement(TextButton, { className: classes.textLink, underline: "always", skin: "light", as: "a", href: link, target: target, ...commonProps }, children)); } else { return (React.createElement(Button, { className: classes.button, type: "button", size: "small", skin: "transparent", ...commonProps }, children)); } }; ActionButton.propTypes = { children: PropTypes.any, onClick: PropTypes.func, link: PropTypes.string, type: PropTypes.string, target: PropTypes.string, }; ActionButton.displayName = 'Notification.ActionButton'; export default ActionButton; //# sourceMappingURL=ActionButton.js.map