29 lines
795 B
TypeScript
29 lines
795 B
TypeScript
import type { OdFileObject } from '../../types'
|
|
|
|
import { FC } from 'react'
|
|
|
|
import { PreviewContainer, DownloadBtnContainer } from './Containers'
|
|
import DownloadButtonGroup from '../DownloadBtnGtoup'
|
|
|
|
const ImagePreview: FC<{ file: OdFileObject }> = ({ file }) => {
|
|
return (
|
|
<>
|
|
<PreviewContainer>
|
|
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
<img
|
|
className="mx-auto"
|
|
src={file['@microsoft.graph.downloadUrl']}
|
|
alt={file.name}
|
|
width={file.image?.width}
|
|
height={file.image?.height}
|
|
/>
|
|
</PreviewContainer>
|
|
<DownloadBtnContainer>
|
|
<DownloadButtonGroup downloadUrl={file['@microsoft.graph.downloadUrl']} />
|
|
</DownloadBtnContainer>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default ImagePreview
|