META-INF.resources.js.components.document-previewer.DocumentPreviewerWrapper.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.digital.signature.web
Show all versions of com.liferay.digital.signature.web
Liferay Digital Signature Web
The newest version!
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
import {ClayPaginationWithBasicItems} from '@clayui/pagination';
import {sub} from 'frontend-js-web';
import React, {useState} from 'react';
import {OriginalDocumentTag} from '../original-document-tag/OriginalDocumentTag';
import EmptyState from '../table/EmptyState';
import DocumentPreviewer from './DocumentPreviewer';
import ImagePreviewer from './ImagePreviewer';
const UnavailablePreview = ({
description = Liferay.Language.get(
'the-envelope-does-not-have-a-document-to-preview'
),
}) => (
);
const DocumentPreview = ({fileEntry}) => {
if (fileEntry.imageURL) {
return ;
}
if (fileEntry.previewFileURL) {
return (
);
}
return (
);
};
const DocumentPreviewerWrapper = ({fileEntries = []}) => {
const [documentPage, setDocumentPage] = useState(1);
const fileEntry = fileEntries[documentPage - 1];
if (!fileEntries.length) {
return ;
}
return (
<>
{sub(
Liferay.Language.get('document-x-of-x'),
documentPage,
fileEntries.length
)}
>
);
};
export default DocumentPreviewerWrapper;