import { useAxiosGet } from "../../../../../utilities/useAxiosGet.mjs";
import { c } from "react-compiler-runtime";
import React from "react";
import { ConfigService, UdpAttachmentItem } from "udp-react-stencil-component-library";
//#region src/udp/pages/UdpTransactionsPage/components/transactionAttachment/TransactionAttachment.jsx
const TransactionAttachment = (props) => {
	const $ = c(10);
	const { attachment, isLastItem } = props;
	let t0;
	if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = {};
		$[0] = t0;
	} else t0 = $[0];
	const [t1] = useAxiosGet(ConfigService.productV1ApiUrl, `UdpTransactionAttachment/${attachment?.transactionAttachmentId}/udpDriveFile/download`, t0, !!!attachment?.transactionAttachmentId);
	const { data: attachmentWithDownloadLink, loading: isLoading } = t1;
	const t2 = attachment?.fileName;
	const t3 = attachment?.fileSize;
	const t4 = attachment?.extension;
	const t5 = attachment?.updatedByName;
	const t6 = attachment?.lastUpdated;
	const t7 = attachmentWithDownloadLink?.link;
	let t8;
	if ($[1] !== isLastItem || $[2] !== isLoading || $[3] !== t2 || $[4] !== t3 || $[5] !== t4 || $[6] !== t5 || $[7] !== t6 || $[8] !== t7) {
		t8 = /* @__PURE__ */ React.createElement(UdpAttachmentItem, {
			loading: isLoading,
			fileName: t2,
			fileSize: t3,
			fileExtension: t4,
			uploadedBy: t5,
			uploadedDate: t6,
			isLastItem,
			downloadUrl: t7
		});
		$[1] = isLastItem;
		$[2] = isLoading;
		$[3] = t2;
		$[4] = t3;
		$[5] = t4;
		$[6] = t5;
		$[7] = t6;
		$[8] = t7;
		$[9] = t8;
	} else t8 = $[9];
	return t8;
};
//#endregion
export { TransactionAttachment };

//# sourceMappingURL=TransactionAttachment.mjs.map