import { j as r } from "../../node_modules/react/jsx-runtime.mjs";
import { useMemo as c } from "react";
import C from "../../assets/iconfont/index.mjs";
import "./index.less.mjs";
import s from "../../node_modules/antd/es/theme/index.mjs";
import j from "../../node_modules/antd/es/badge/index.mjs";
const p = ({ name: o, config: t, title: n, children: l, badgeProps: m, ...v }) => {
  const { onClick: I, currentName: e } = v, a = s.useToken().token.colorPrimary, i = s.useToken().token.colorText, x = c(() => t[o === e ? "activeIcon" : "inactiveIcon"], [t, e, o]), b = c(() => o === e ? t.activeColor : t.inactiveColor, [t.activeColor, t.inactiveColor, e, o]), d = c(() => o === e ? a : i, [a, e, o, i]), u = c(() => t[o === e ? "activeImage" : "inactiveImage"], [t, e, o]);
  return r.jsxs("div", { className: "tabbarItem", onClick: () => I(o), children: [r.jsx("div", { className: `${"activeIcon" in t ? "tabbarItemIcon" : "tabbarItemImage"}`, children: r.jsx(j, { ...m, children: r.jsx("div", { className: "activeIcon" in t ? "icon" : "image", children: "activeIcon" in t ? r.jsx(C, { name: x, color: b, size: 22 }) : r.jsx("img", { src: u }) }) }) }), r.jsx("div", { className: "tabbarItemText", style: { color: d }, children: n || l })] });
}, y = p;
export {
  y as default
};
