"use client";
import { jsx as n, jsxs as f } from "react/jsx-runtime";
import { forwardRef as p } from "react";
import { cn as t } from "../../utils/cn/cn.es.js";
import i from "../../components/Tabs/tabs.module.css";
import { Icon as c } from "../Icon/Icon.es.js";
function u({ activeTab: o, tabs: r, onTabClick: l, size: s = "sm", activeLinePosition: m = "bottom", inverted: d }, a) {
  return /* @__PURE__ */ n("div", { ref: a, className: i.container, children: r.map((e) => /* @__PURE__ */ f(
    "button",
    {
      className: t(
        i.tab,
        i[s],
        {
          [i.inverted]: d,
          [i.activeTab]: o === e.value,
          [i.disabled]: e.disabled,
          [i.brackets]: s !== "sm" && o === e.value && r.length > 1
        },
        i[m],
        e.className
      ),
      disabled: e.disabled,
      onClick: () => l(e.value),
      children: [
        e.prefixIcon && /* @__PURE__ */ n("div", { className: i.iconWrap, children: /* @__PURE__ */ n(c, { name: e.prefixIcon }) }),
        /* @__PURE__ */ n("div", { children: e.label }),
        e.suffixIcon && /* @__PURE__ */ n("div", { className: i.iconWrap, children: /* @__PURE__ */ n(c, { name: e.suffixIcon }) })
      ]
    },
    String(e.value)
  )) });
}
const g = p(u);
export {
  g as Tabs
};
