import React, { useCallback, useState } from 'react'; type Props = { src: string; key: string; alt?: string; lang?: string; width: number; height: number; onClick?: () => void; } export const GIFV: React.FC = ({ src, alt, lang, width, height, onClick, })=> { const [loading, setLoading] = useState(true); const handleLoadedData: React.ReactEventHandler = useCallback(() => { setLoading(false); }, [setLoading]); const handleClick: React.MouseEventHandler = useCallback((e) => { if (onClick) { e.stopPropagation(); onClick(); } }, [onClick]); return (
{loading && ( )}
); };