2019-10-11 02:37:18 +02:00
|
|
|
// @flow
|
2021-11-11 00:59:37 +01:00
|
|
|
import React from 'react';
|
2019-10-11 02:37:18 +02:00
|
|
|
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 = {
|
2021-11-11 00:59:37 +01:00
|
|
|
params: UpdatePublishFormData,
|
|
|
|
progress: string,
|
|
|
|
xhr?: () => void,
|
2019-10-11 02:37:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default function WebUploadItem(props: Props) {
|
2021-11-11 00:59:37 +01:00
|
|
|
const { params, progress, xhr } = props;
|
2019-10-11 02:37:18 +02:00
|
|
|
|
|
|
|
return (
|
2021-11-11 00:59:37 +01:00
|
|
|
<li className={'claim-preview claim-preview--padded 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">
|
2020-01-30 23:25:15 +01:00
|
|
|
<div className="claim-preview__title">{params.title}</div>
|
2021-11-11 00:59:37 +01:00
|
|
|
{xhr && (
|
|
|
|
<div className="card__actions--inline">
|
|
|
|
<Button
|
|
|
|
button="link"
|
|
|
|
onClick={() => {
|
|
|
|
xhr.abort();
|
|
|
|
}}
|
|
|
|
label={__('Cancel')}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
<h2>lbry://{params.name}</h2>
|
|
|
|
<div className={'claim-upload__progress--outer card--inline'}>
|
|
|
|
<div className={'claim-upload__progress--inner'} style={{ width: `${progress}%` }}>
|
|
|
|
Uploading...
|
2019-10-11 02:37:18 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
);
|
|
|
|
}
|