import { useState, useEffect, useRef, useCallback } from 'react'
import { useHotkeys } from 'react-hotkeys-hook'
import type { Photo } from '../../types/photo'
import {
getPreviewImageSrc,
getPreviewFallbackSrc,
getVideoSrc,
isVideo,
} from './previewSrc'
interface PreviewImageProps {
photo: Photo
}
const MIN_SCALE = 1
const MAX_SCALE = 8
const WHEEL_STEP = 1.15
export function PreviewImage({ photo }: PreviewImageProps) {
if (isVideo(photo)) {
return