import React__default from 'react';
import { FileInfoContainer, FileInfo, InfoSubheading, SizeBody, MessageBody } from './styles.js';
import { Spinner } from '../Spinner/index.js';
import { getUploaderTitle, getUploaderDescription } from './utils.js';
import AlertCircle from '../../icons/AlertCircle.js';
import CheckCircle from '../../icons/CheckCircle.js';

const FileInfoWrapper = ({ file, uploaderTitle, maxSizeDescription, loading, successMessage, errorMessage, }) => (React__default.createElement(FileInfoContainer, null,
    React__default.createElement(FileInfo, null,
        loading && (React__default.createElement("div", null,
            React__default.createElement(Spinner, { variant: "secondary", size: "M" }))),
        React__default.createElement(InfoSubheading, { title: file && typeof file !== 'string' ? file.name : '' }, getUploaderTitle({ file, uploaderTitle })),
        React__default.createElement(SizeBody, null, getUploaderDescription({ file, maxSizeDescription }))),
    successMessage && !errorMessage && (React__default.createElement(MessageBody, { messageType: "success" },
        React__default.createElement(CheckCircle, null),
        successMessage)),
    errorMessage && !successMessage && (React__default.createElement(MessageBody, { messageType: "error" },
        React__default.createElement(AlertCircle, null),
        errorMessage))));

export { FileInfoWrapper };
