import { _objectWithoutProperties } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectWithoutProperties.js";
import useSharedState from "../../../../../../hooks/useSharedState.js";
import { Context } from "../../../../model.js";
import { getValueByKeys } from "../../utils/index.js";
import React from "react";
import classNames from "classnames";
import "./index.less";
//#region src/components/table/Table/fields/text/Show/index.tsx
const _excluded = [
	"title",
	"editable",
	"dataIndex",
	"field_type",
	"record",
	"handleSave",
	"action",
	"contentClassName"
];
const Show = (props) => {
	const modal = useSharedState(Context), { title, editable, dataIndex, field_type, record, handleSave, action, contentClassName } = props;
	_objectWithoutProperties(props, _excluded);
	const onClick = () => {
		var _modal$state;
		if (action && (modal === null || modal === void 0 || (_modal$state = modal.state) === null || _modal$state === void 0 || (_modal$state = _modal$state.utils) === null || _modal$state === void 0 ? void 0 : _modal$state.action)) {
			var _modal$state2;
			modal === null || modal === void 0 || (_modal$state2 = modal.state) === null || _modal$state2 === void 0 || (_modal$state2 = _modal$state2.utils) === null || _modal$state2 === void 0 || _modal$state2.action({
				type: action,
				data: record
			});
		}
	};
	return /* @__PURE__ */ React.createElement("div", {
		className: classNames(contentClassName || "", { "table-fields-text-link": action }, contentClassName),
		onClick
	}, getValueByKeys(record, dataIndex));
};
//#endregion
export { Show as default };
