const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
const require_index = require("../../tabs/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
//#region src/components/table/Tabs/index.tsx
const Tabs = ({ items = [], type = "default", onChange, show = false }) => {
	const tabItems = (0, react.useMemo)(() => {
		return items.map((item, index) => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, item), {}, {
			key: String(index),
			label: item.name
		}));
	}, [items]);
	const handleChange = (0, react.useCallback)((activeKey) => {
		const currentTab = items[Number(activeKey)];
		if (currentTab && onChange) onChange(currentTab);
	}, [items, onChange]);
	if (!(items === null || items === void 0 ? void 0 : items.length) || !show) return null;
	return /* @__PURE__ */ react.default.createElement(require_index.default, {
		items: tabItems,
		onChange: handleChange,
		type
	});
};
//#endregion
exports.default = Tabs;
