2019-12-30 20:54:53 +01:00
|
|
|
// @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;
|
2019-12-30 20:54:53 +01:00
|
|
|
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 />
|
2019-12-30 20:54:53 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return <Spinner />;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
export default EmbedWrapperPage;
|