import { _ as __rest } from './tslib.es6-ab63fd84.js';
import React__default from 'react';
import { B as Button$1 } from './index-f71a880f.js';

/**
 * @deprecated Consider to use at '@hhgtech/hhg-components/mantine'
 */
const Button = (_a) => {
    var { size, color = 'primary', isDisabled, isBlock, title, onClick, icon, iconPosition = 'left', children, isLoading = false, loadingText, dataEventCategory, dataEventAction, dataEventLabel, dataProductChannel, dataProductSku, dataProductBrand, dataProductName, dataProductPrice, dataProductCategory, dataProductPosition, type } = _a, rest = __rest(_a, ["size", "color", "isDisabled", "isBlock", "title", "onClick", "icon", "iconPosition", "children", "isLoading", "loadingText", "dataEventCategory", "dataEventAction", "dataEventLabel", "dataProductChannel", "dataProductSku", "dataProductBrand", "dataProductName", "dataProductPrice", "dataProductCategory", "dataProductPosition", "type"]);
    const gtmProps = {
        'data-event-category': dataEventCategory,
        'data-event-action': dataEventAction,
        'data-event-label': dataEventLabel,
        'data-product-channel': dataProductChannel,
        'data-product-sku': dataProductSku,
        'data-product-brand': dataProductBrand,
        'data-product-name': dataProductName,
        'data-product-price': dataProductPrice,
        'data-product-category': dataProductCategory,
        'data-product-position': dataProductPosition,
    };
    return (React__default.createElement(Button$1, Object.assign({}, gtmProps, { size: size, variant: color === 'transparent' ? 'white' : color === 'danger' ? 'error' : color, disabled: isDisabled, onClick: (evt) => {
            !isLoading && !isDisabled && onClick && onClick(evt);
        }, title: title, loading: isLoading, type: type || 'submit', leftIcon: iconPosition === 'left' ? icon : undefined, rightIcon: iconPosition === 'right' ? icon : undefined, 
        // hasIcon={!!icon || undefined}
        w: isBlock ? '100%' : undefined, p: isBlock ? '12px auto' : undefined, "data-color": color, "data-size": size, "data-block": isBlock, "data-has-icon": !!icon || undefined, "data-theme": rest.theme, "data-is-loading": isLoading }, rest), isLoading ? loadingText || children : children));
};

export { Button as B };
