"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.AcceptedFilesInfo = AcceptedFilesInfo;
var _react = _interopRequireDefault(require("react"));
var _classnames = _interopRequireDefault(require("classnames"));
var _useTranslation = require("../hooks/use-translation");
var _jsxRuntime = require("react/jsx-runtime");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/** Visual representation of supported files format. */
function AcceptedFilesInfo({
  acceptedFilesList = [],
  className = '',
  buildSupportedFilesText,
  testId = 'accepted-files-info'
}) {
  const {
    t
  } = (0, _useTranslation.useTranslation)();
  if (acceptedFilesList.length <= 0) {
    return null;
  }
  const supportedFileTypes = `.${acceptedFilesList.join(', .')}`;
  const supportedFilesTranslated = buildSupportedFilesText ? buildSupportedFilesText(supportedFileTypes) : t('Accepted formats: {{supportedFileTypes}}', {
    supportedFileTypes
  });
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
    className: (0, _classnames.default)('accepted-files-info', className),
    "test-id": testId,
    children: supportedFilesTranslated
  });
}