Merge pull request #3960 from overleaf/cmg-binary-file
[BinaryFile] Reopening of Binary file React migration GitOrigin-RevId: 050e66e3321bd6579d44932b669fc0a31df06d18
This commit is contained in:
committed by
Copybot
parent
23c73b9bf1
commit
3dfcb95802
@@ -0,0 +1,21 @@
|
||||
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,
|
||||
}
|
||||
Reference in New Issue
Block a user