import React from 'react';
const baseClass = 'popup-button';
export const PopupTrigger = (props)=>{
    const { active, button, buttonType, className, setActive } = props;
    const classes = [
        baseClass,
        className,
        `${baseClass}--${buttonType}`
    ].filter(Boolean).join(' ');
    const handleClick = ()=>{
        setActive(!active);
    };
    if (buttonType === 'none') {
        return null;
    }
    if (buttonType === 'custom') {
        return /*#__PURE__*/ React.createElement("div", {
            className: classes,
            onClick: handleClick,
            onKeyDown: (e)=>{
                if (e.key === 'Enter') handleClick();
            },
            role: "button",
            tabIndex: 0
        }, button);
    }
    return /*#__PURE__*/ React.createElement("button", {
        className: classes,
        onClick: ()=>setActive(!active),
        tabIndex: 0,
        type: "button"
    }, button);
};

//# sourceMappingURL=index.js.map