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