2019-10-11 02:37:18 +02:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import Button from 'component/button';
|
|
|
|
import CardMedia from 'component/cardMedia';
|
|
|
|
type Props = {
|
|
|
|
params: UpdatePublishFormData,
|
|
|
|
progress: string,
|
|
|
|
xhr?: () => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default function WebUploadItem(props: Props) {
|
|
|
|
const { params, progress, xhr } = props;
|
|
|
|
|
|
|
|
return (
|
2019-10-22 22:42:13 +02:00
|
|
|
<li className={'claim-preview card--inline'}>
|
2019-10-11 02:37:18 +02:00
|
|
|
<CardMedia thumbnail={params.thumbnail_url} />
|
|
|
|
<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>
|
|
|
|
);
|
|
|
|
}
|