import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { SoftBetaBadge } from '../Badge';
const renderContent = (children, label, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType) => (React.createElement("div", { className: "softKeyPadMenuItem__inner" },
    betaBadgeLabel &&
        React.createElement("span", { className: "softKeyPadMenuItem__betaBadgeWrapper" },
            React.createElement(SoftBetaBadge, { className: "softKeyPadMenuItem__betaBadge", label: betaBadgeLabel, iconType: betaBadgeIconType, tooltipContent: betaBadgeTooltipContent })),
    React.createElement("div", { className: "softKeyPadMenuItem__icon" }, children),
    React.createElement("p", { className: "softKeyPadMenuItem__label" }, label)));
const commonPropTypes = {
    children: PropTypes.node.isRequired,
    label: PropTypes.node.isRequired,
    /**
     * Add a badge to the card to label it as "Beta" or other non-GA state
     */
    betaBadgeLabel: PropTypes.string,
    /**
     * Supply an icon type if the badge should just be an icon
     */
    betaBadgeIconType: null,
    /**
     * Add a description to the beta badge (will appear in a tooltip)
     */
    betaBadgeTooltipContent: PropTypes.node,
};
export const SoftKeyPadMenuItem = ({ href, label, children, className, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType, ...rest }) => {
    const classes = classNames('softKeyPadMenuItem', {
        'softKeyPadMenuItem--hasBetaBadge': betaBadgeLabel,
    }, className);
    return (React.createElement("a", Object.assign({ href: href, className: classes, role: "menuitem" }, rest), renderContent(children, label, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType)));
};
export const SoftKeyPadMenuItemButton = ({ onClick, label, children, className, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType, ...rest }) => {
    const classes = classNames('softKeyPadMenuItem', {
        'softKeyPadMenuItem--hasBetaBadge': betaBadgeLabel,
    }, className);
    return (React.createElement("button", Object.assign({ type: "button", onClick: onClick, className: classes }, rest), renderContent(children, label, betaBadgeLabel, betaBadgeTooltipContent, betaBadgeIconType)));
};
//# sourceMappingURL=SoftKeyPadMenuItem.js.map