'use strict';

var React = require('react');
var clsx = require('clsx');
var jsxRuntime = require('react/jsx-runtime');

const UploadItemLink = /*#__PURE__*/React.forwardRef(({
  children,
  url,
  onDownload,
  singleFileUpload
}, ref) => {
  if (!url) {
    return /*#__PURE__*/jsxRuntime.jsx("div", {
      ref: ref,
      className: clsx.clsx('np-upload-input__item-container'),
      children: children
    });
  }
  return /*#__PURE__*/jsxRuntime.jsx("a", {
    ref: ref,
    href: url,
    target: "_blank",
    rel: "noopener noreferrer",
    className: clsx.clsx('np-upload-input__item-link', singleFileUpload ? 'np-upload-input__item-link--single-file' : ''),
    onClick: onDownload,
    children: children
  });
});

exports.UploadItemLink = UploadItemLink;
//# sourceMappingURL=UploadItemLink.js.map
