mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
22 lines
514 B
JavaScript
22 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,
|
||
|
}
|