33 lines
893 B
React
33 lines
893 B
React
|
// @flow
|
||
|
|
||
|
import React from 'react';
|
||
|
import Lbry from 'lbry-redux';
|
||
|
import Button from 'component/button';
|
||
|
|
||
|
type Props = {
|
||
|
reflectingInfo?: ReflectingUpdate,
|
||
|
checkReflecting: () => void,
|
||
|
};
|
||
|
|
||
|
const PublishPending = (props: Props) => {
|
||
|
const { reflectingInfo = {}, checkReflecting } = props;
|
||
|
const { fileListItem, progress, stalled } = reflectingInfo;
|
||
|
const sdHash = fileListItem && fileListItem.sd_hash;
|
||
|
const reflecting = Object.keys(reflectingInfo).length;
|
||
|
if (stalled) {
|
||
|
return (
|
||
|
<Button
|
||
|
button="link"
|
||
|
label={__('Upload stalled. Retry?')}
|
||
|
onClick={() => Lbry.file_reflect({ sd_hash: sdHash }).then(() => checkReflecting())}
|
||
|
/>
|
||
|
);
|
||
|
} else if (reflecting) {
|
||
|
return <span>{__('Uploading (%progress%%) ', { progress: progress })}</span>;
|
||
|
} else {
|
||
|
return <span>{__('Confirming')}</span>;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default PublishPending;
|