mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
3dfcb95802
[BinaryFile] Reopening of Binary file React migration GitOrigin-RevId: 050e66e3321bd6579d44932b669fc0a31df06d18
21 lines
514 B
JavaScript
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,
|
|
}
|