lbry-desktop/ui/component/fileThumbnail/FreezeframeWrapper.jsx
2020-05-28 13:07:51 -04:00

28 lines
711 B
JavaScript

import React, { useEffect } from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import Freezeframe from './FreezeframeLite';
const FreezeframeWrapper = props => {
const imgRef = React.useRef();
const freezeframe = React.useRef();
const { src, className } = props;
useEffect(() => {
freezeframe.current = new Freezeframe(imgRef.current);
}, []);
return (
<div className={classnames(className, 'freezeframe-wrapper')}>
<img ref={imgRef} src={src} className="freezeframe-img" />
</div>
);
};
FreezeframeWrapper.propTypes = {
src: PropTypes.string.isRequired,
className: PropTypes.string.isRequired,
};
export default FreezeframeWrapper;