import React, { useState } from "react";
import { onClickA11y } from "../utils";
const defaultProps = {
    label: "",
    onClick: () => { },
    iconClass: "",
    disabled: false,
    showDefaultIcon: false,
    className: "row-btn",
};
const ButtonRow = ({ label, onClick, iconClass, disabled, img, showDefaultIcon, className, ariaSelected, role = "button", }) => {
    const [imgError, setImgError] = useState(false);
    return (React.createElement("div", { className: disabled ? "row-btn-disabled" : className, role: role, "aria-selected": ariaSelected, ...onClickA11y(() => {
            !disabled && onClick();
        }) },
        img && (React.createElement("img", { src: img, alt: "", style: showDefaultIcon || imgError ? { display: "none" } : { width: "auto", height: "20px" }, onError: () => {
                setImgError(true);
            } })),
        (showDefaultIcon || imgError) && React.createElement("i", { className: "ff-finsemble default-img" }),
        React.createElement("span", { className: "row__lbl" }, label),
        React.createElement("i", { className: iconClass, "aria-hidden": true })));
};
ButtonRow.defaultProps = defaultProps;
export default ButtonRow;
//# sourceMappingURL=ButtonRow.js.map