overleaf/services/web/frontend/js/features/binary-file/components/binary-file-image.js
Chrystal Maria Griffiths 3dfcb95802 Merge pull request #3960 from overleaf/cmg-binary-file
[BinaryFile] Reopening of Binary file React migration

GitOrigin-RevId: 050e66e3321bd6579d44932b669fc0a31df06d18
2021-04-29 02:09:38 +00:00

21 lines
514 B
JavaScript

import React from 'react'
import PropTypes from 'prop-types'
export default function BinaryFileImage({ fileName, fileId, onLoad, onError }) {
return (
<img
src={`/project/${window.project_id}/file/${fileId}`}
onLoad={onLoad}
onError={onError}
onAbort={onError}
alt={fileName}
/>
)
}
BinaryFileImage.propTypes = {
fileName: PropTypes.string.isRequired,
fileId: PropTypes.string.isRequired,
onLoad: PropTypes.func.isRequired,
onError: PropTypes.func.isRequired,
}