'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var React = require('react');
var styles = require('./styles.js');
var index = require('../Spinner/index.js');
var utils = require('./utils.js');
var AlertCircle = require('../../icons/AlertCircle.js');
var CheckCircle = require('../../icons/CheckCircle.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

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

exports.FileInfoWrapper = FileInfoWrapper;
