import { __assign, __rest } from "tslib";
import React, { forwardRef, cloneElement } from "react";
import { TabStyled, TabContent, TabContentS } from "./styles";
var Tab = forwardRef(function (_a, ref) {
    var label = _a.label, className = _a.className, onClick = _a.onClick, isDisabled = _a.isDisabled, icon = _a.icon, size = _a.size, style = _a.style, as = _a.as, children = _a.children, props = __rest(_a, ["label", "className", "onClick", "isDisabled", "icon", "size", "style", "as", "children"]);
    return (React.createElement(TabStyled, __assign({}, props, { role: "tab", className: className, size: size, isDisabled: isDisabled, onClick: function (_e) {
            !isDisabled && onClick && onClick(_e);
        }, style: style, ref: ref, as: as }),
        icon && cloneElement(icon, { className: "tab__icon" }),
        label &&
            (size === "m" ? (React.createElement(TabContentS, { type: "pavo", forwardedAs: "span" }, label)) : (React.createElement(TabContent, { type: "phoenix", forwardedAs: "span" }, label))),
        children));
});
Tab.displayName = "Tab";
export default Tab;
