import { forwardRef } from 'react';
import { clsx } from 'clsx';
import { jsx } from 'react/jsx-runtime';

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

export { UploadItemLink };
//# sourceMappingURL=UploadItemLink.mjs.map
