@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
37 lines (36 loc) • 1.05 kB
JavaScript
"use client";
import Tabs from "../../base-ui/Tabs/Tabs.mjs";
import { styles } from "./style.mjs";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
//#region src/dashboard/PageTabs/PageTabs.tsx
function PageTabs({ label, onChange, tabs, value }) {
return /* @__PURE__ */ jsx("div", {
"aria-label": label,
className: styles.root,
role: "navigation",
children: /* @__PURE__ */ jsx(Tabs, {
activeKey: value,
classNames: {
list: styles.list,
panel: styles.panel,
tab: styles.tab
},
items: tabs.map((tab) => ({
children: tab.content,
key: tab.value,
label: /* @__PURE__ */ jsxs(Fragment, { children: [tab.label, tab.count !== void 0 ? /* @__PURE__ */ jsx("span", {
className: styles.count,
children: tab.count
}) : null] })
})),
onChange: (next) => {
const tab = tabs.find((item) => item.value === next);
if (tab) onChange(tab.value);
}
})
});
}
PageTabs.displayName = "PageTabs";
//#endregion
export { PageTabs as default };
//# sourceMappingURL=PageTabs.mjs.map