mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-04 19:24:53 -05:00
25 lines
450 B
TypeScript
25 lines
450 B
TypeScript
|
import { useProjectContext } from '../../../shared/context/project-context'
|
||
|
|
||
|
export default function FileViewImage({
|
||
|
fileName,
|
||
|
fileId,
|
||
|
onLoad,
|
||
|
onError,
|
||
|
}: {
|
||
|
fileName: string
|
||
|
fileId: string
|
||
|
onLoad: () => void
|
||
|
onError: () => void
|
||
|
}) {
|
||
|
const { _id: projectId } = useProjectContext()
|
||
|
|
||
|
return (
|
||
|
<img
|
||
|
src={`/project/${projectId}/file/${fileId}`}
|
||
|
onLoad={onLoad}
|
||
|
onError={onError}
|
||
|
alt={fileName}
|
||
|
/>
|
||
|
)
|
||
|
}
|