import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Fade } from '../../transitions/Fade';
import { FileError } from './FileError';
import { FileLoading } from './FileLoading';
import { FilePreview } from './FilePreview';
import { Wrapper } from './styles';
export const PreviewFileUploaderFile = (props) => {
    const { id, name, type, file, url, size, status, generateDownloadLink, onRetry, onDelete, onView, selfFiles, setErrorStatusFile, isHidePersonalData, PdfViewer, isDeletingFile, } = props;
    const { isLoading, isUploadError, isRestrictionError, errorMsg, progress } = status || {};
    const isError = isUploadError || isRestrictionError;
    return (_jsx(Fade, { in: true, children: _jsxs(Wrapper, { "$isLoading": isLoading, "$isError": isError, children: [!isLoading && !isError && (_jsx(FilePreview, { fileId: id, fileName: name, fileType: type, file: file, fileUrl: url, fileSize: size, generateDownloadLink: generateDownloadLink, onView: onView, onDelete: onDelete, isHidePersonalData: isHidePersonalData, PdfViewer: PdfViewer, isDeletingFile: isDeletingFile })), isLoading && (_jsx(FileLoading, { selfFiles: selfFiles, setErrorStatusFile: setErrorStatusFile, fileId: id, fileName: name, fileSize: size, progress: progress })), isError && (_jsx(FileError, { fileId: id, fileName: name, file: file, fileSize: size, errorMsg: errorMsg, isUploadError: isUploadError, onRetry: onRetry, onDelete: onDelete }))] }) }));
};
