lbry-desktop/ui/page/embedWrapper/view.jsx

31 lines
611 B
React
Raw Normal View History

// @flow
import React, { useEffect } from 'react';
import FileRender from 'component/fileRender';
import Spinner from 'component/spinner';
type Props = {
uri: string,
resolveUri: string => void,
claim: Claim,
};
const EmbedWrapperPage = (props: Props) => {
2020-01-27 22:37:54 +01:00
const { resolveUri, claim, uri } = props;
useEffect(() => {
if (resolveUri && uri) {
resolveUri(uri);
}
}, []);
if (uri && claim) {
return (
<div className={'embed__wrapper'}>
2020-01-27 22:37:54 +01:00
<FileRender uri={uri} embedded />
</div>
);
} else {
return <Spinner />;
}
};
export default EmbedWrapperPage;