import React from 'react';
import { ConfigService, UdpAttachmentItem } from 'udp-react-stencil-component-library';
import { useAxiosGet } from '../../../../../utilities';
export const TransactionAttachment = (props) => {
    const { attachment, isLastItem } = props;
    const [{ data: attachmentWithDownloadLink, loading: isLoading }] = useAxiosGet(ConfigService.productV1ApiUrl, `UdpTransactionAttachment/${attachment === null || attachment === void 0 ? void 0 : attachment.transactionAttachmentId}/udpDriveFile/download`, {}, !!!(attachment === null || attachment === void 0 ? void 0 : attachment.transactionAttachmentId));
    return (React.createElement(UdpAttachmentItem, { loading: isLoading, fileName: attachment === null || attachment === void 0 ? void 0 : attachment.fileName, fileSize: attachment === null || attachment === void 0 ? void 0 : attachment.fileSize, fileExtension: attachment === null || attachment === void 0 ? void 0 : attachment.extension, uploadedBy: attachment === null || attachment === void 0 ? void 0 : attachment.updatedByName, uploadedDate: attachment === null || attachment === void 0 ? void 0 : attachment.lastUpdated, isLastItem: isLastItem, downloadUrl: attachmentWithDownloadLink === null || attachmentWithDownloadLink === void 0 ? void 0 : attachmentWithDownloadLink.link }));
};
//# sourceMappingURL=TransactionAttachment.js.map