mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
48 lines
1.1 KiB
JavaScript
48 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { AnchorButton } from '@blueprintjs/core';
|
|
|
|
import { DialogContent, PdfDocumentPreview, T } from 'components';
|
|
import { usePdfInvoice } from 'hooks/query';
|
|
|
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
|
import { compose } from 'utils';
|
|
|
|
function InvoicePdfPreviewDialogContent({
|
|
// #withDialog
|
|
closeDialog,
|
|
}) {
|
|
const { isLoading, pdfUrl } = usePdfInvoice(1);
|
|
|
|
return (
|
|
<DialogContent>
|
|
<div class="dialog__header-actions">
|
|
<AnchorButton
|
|
href={pdfUrl}
|
|
download={'invoice.pdf'}
|
|
minimal={true}
|
|
outlined={true}
|
|
>
|
|
<T id={'pdf_preview.preview.button'} />
|
|
</AnchorButton>
|
|
|
|
<AnchorButton
|
|
href={pdfUrl}
|
|
target={'__blank'}
|
|
minimal={true}
|
|
outlined={true}
|
|
>
|
|
<T id={'pdf_preview.download.button'} />
|
|
</AnchorButton>
|
|
</div>
|
|
|
|
<PdfDocumentPreview
|
|
height={760}
|
|
width={1000}
|
|
isLoading={isLoading}
|
|
url={pdfUrl}
|
|
/>
|
|
</DialogContent>
|
|
);
|
|
}
|
|
|
|
export default compose(withDialogActions)(InvoicePdfPreviewDialogContent); |