const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../../../../locales/index.js");
const require_index$1 = require("../ButtonIcon/index.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _ant_design_icons = require("@ant-design/icons");
//#region src/components/table/Actions/component/ViewMode/index.tsx
const itemsMap = {
	grid: {
		key: "grid",
		label: require_index.getText("table-action-view-mode-grid")
	},
	gallery: {
		key: "gallery",
		label: require_index.getText("table-action-view-mode-gallery")
	},
	kanban: {
		key: "kanban",
		label: require_index.getText("table-action-view-mode-kanban")
	}
};
const defaultArr = [];
const ViewMode = (props) => {
	const { view, value, onChange } = props;
	const { defaultViewMode, modeList = defaultArr } = view;
	const items = (0, react.useMemo)(() => {
		return modeList.map((item) => itemsMap[item]);
	}, [modeList]);
	const handleClick = (e) => {
		onChange === null || onChange === void 0 || onChange(e.key);
	};
	return /* @__PURE__ */ react.default.createElement(antd.Dropdown, {
		menu: {
			items,
			selectable: true,
			selectedKeys: value ? [value] : [defaultViewMode],
			onClick: handleClick
		},
		placement: "bottomRight"
	}, /* @__PURE__ */ react.default.createElement(require_index$1.default, { isActive: false }, /* @__PURE__ */ react.default.createElement(_ant_design_icons.BarChartOutlined, { style: {
		cursor: "pointer",
		fontSize: 18
	} })));
};
//#endregion
exports.default = ViewMode;
