//#region src/components/Sales/utils/index.tsx
const getIamgeFromMedia = (data, type = "findAll") => {
	if (!data || !Array.isArray(data) || (data === null || data === void 0 ? void 0 : data.length) <= 0) return type === "findAll" ? [] : "";
	if (type === "findOne") {
		var _data$find;
		return ((_data$find = data.find((v) => v.type === "image" && !!v.url)) === null || _data$find === void 0 ? void 0 : _data$find.url) || "";
	} else return data.map((v) => {
		if (v.type === "image" && !!v.url) return v.url;
	});
};
//#endregion
exports.getIamgeFromMedia = getIamgeFromMedia;
