11import { useEffect , useState } from 'react'
2+ import { useConfig } from '../../hooks/useConfig.js'
23import { FileSource } from '../../lib/sources/types.js'
3- import { contentTypes , parseFileSize } from '../../lib/utils.js'
4+ import { cn , contentTypes , parseFileSize } from '../../lib/utils.js'
5+ import styles from '../../styles/viewers/ImageView.module.css'
46import { Spinner } from '../Layout.js'
57import ContentHeader from './ContentHeader.js'
68
@@ -20,6 +22,7 @@ interface Content {
2022export default function ImageView ( { source, setError } : ViewerProps ) {
2123 const [ content , setContent ] = useState < Content > ( )
2224 const [ isLoading , setIsLoading ] = useState ( true )
25+ const { customClass } = useConfig ( )
2326
2427 const { fileName, resolveUrl, requestInit } = source
2528
@@ -54,7 +57,7 @@ export default function ImageView({ source, setError }: ViewerProps) {
5457 return < ContentHeader content = { content } >
5558 { content ?. dataUri && < img
5659 alt = { source . sourceId }
57- className = ' image'
60+ className = { cn ( styles . image , customClass ?. imageView ) }
5861 src = { content . dataUri } /> }
5962
6063 { isLoading && < div className = 'center' > < Spinner /> </ div > }
0 commit comments