2019-10-10 20:37:18 -04:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import Button from 'component/button';
|
2020-01-06 13:32:35 -05:00
|
|
|
import FileThumbnail from 'component/fileThumbnail';
|
2019-10-10 20:37:18 -04:00
|
|
|
type Props = {
|
|
|
|
params: UpdatePublishFormData,
|
|
|
|
progress: string,
|
|
|
|
xhr?: () => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function WebUploadItem(props: Props) {
|
|
|
|
const { params, progress, xhr } = props;
|
|
|
|
|
|
|
|
return (
|
2020-02-11 11:50:42 -05:00
|
|
|
<li className={'claim-preview claim-preview--padded claim-preview--inactive card--inline'}>
|
2020-01-06 13:32:35 -05:00
|
|
|
<FileThumbnail thumbnail={params.thumbnail_url} />
|
2019-10-10 20:37:18 -04:00
|
|
|
<div className={'claim-preview-metadata'}>
|
|
|
|
<div className="claim-preview-info">
|
2020-01-30 17:25:15 -05:00
|
|
|
<div className="claim-preview__title">{params.title}</div>
|
2019-10-10 20:37:18 -04:00
|
|
|
{xhr && (
|
|
|
|
<div className="card__actions--inline">
|
|
|
|
<Button
|
2019-10-22 16:42:13 -04:00
|
|
|
button="link"
|
2019-10-10 20:37:18 -04:00
|
|
|
onClick={() => {
|
|
|
|
xhr.abort();
|
|
|
|
}}
|
2019-10-22 16:42:13 -04:00
|
|
|
label={__('Cancel')}
|
2019-10-10 20:37:18 -04:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
2019-10-22 16:42:13 -04:00
|
|
|
<h2>lbry://{params.name}</h2>
|
|
|
|
<div className={'claim-upload__progress--outer card--inline'}>
|
2019-10-10 20:37:18 -04:00
|
|
|
<div className={'claim-upload__progress--inner'} style={{ width: `${progress}%` }}>
|
|
|
|
Uploading...
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
}
|