const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
const require_useTranslationOriginal = require("../../../../hooks/useTranslationOriginal.js");
let react = require("react");
react = require_runtime.__toESM(react);
let _pisell_utils = require("@pisell/utils");
let antd = require("antd");
let src_components_dataSourceComponents_fields_Upload_fallback_png = require("./fallback.png");
src_components_dataSourceComponents_fields_Upload_fallback_png = require_runtime.__toESM(src_components_dataSourceComponents_fields_Upload_fallback_png);
require("./ReadPretty.less");
//#region src/components/dataSourceComponents/fields/Upload/ReadPretty.tsx
const UploadReadPretty = (props) => {
	const { value, enableMultilingual } = props;
	const translationOriginal = require_useTranslationOriginal.default();
	const normalizedValue = (0, react.useMemo)(() => {
		if (!value) return [];
		let processedValue = (0, _pisell_utils.isArr)(value) ? value : [value];
		processedValue = processedValue.map((item) => {
			if (!item) return null;
			if ((0, _pisell_utils.isString)(item)) return item;
			return translationOriginal(item);
		});
		return processedValue.filter((item) => !!item);
	}, [
		value,
		enableMultilingual,
		translationOriginal
	]);
	if (!normalizedValue.length) return null;
	return /* @__PURE__ */ react.default.createElement(antd.Space, null, normalizedValue.map((item, index) => /* @__PURE__ */ react.default.createElement(antd.Image, {
		key: `${String(item)}-${index}`,
		className: "pisell-upload-read-pretty",
		src: String(item),
		width: 100,
		height: 100,
		fallback: src_components_dataSourceComponents_fields_Upload_fallback_png.default,
		preview: { maskClassName: "pisell-upload-read-pretty-mask" }
	})));
};
//#endregion
exports.default = UploadReadPretty;
