import classNames from 'classnames';
import React, { useContext } from 'react';
import { CommonExamContext } from '../context/CommonExamContext';
function File({ element, className, renderChildNodes }) {
    const src = element.getAttribute('src');
    const hasDescription = element.hasChildNodes();
    const { resolveAttachment } = useContext(CommonExamContext);
    return (React.createElement("a", { className: classNames('file e-nowrap', className), href: resolveAttachment(src), download: true }, hasDescription ? (React.createElement(React.Fragment, null,
        renderChildNodes(element),
        " (",
        src,
        ")")) : (src)));
}
export default React.memo(File);
//# sourceMappingURL=File.js.map