// @flow import { STATUSES, MODALS } from 'lbry-redux'; import React from 'react'; import { FormField, FormRow } from 'component/common/form'; import FileSelector from 'component/common/file-selector'; import Button from 'component/button'; type Props = { thumbnail: ?string, formDisabled: boolean, uploadThumbnailStatus: string, thumbnailPath: ?string, openModal: ({ id: string }, {}) => void, updatePublishForm: ({}) => void, resetThumbnailStatus: () => void, }; class SelectThumbnail extends React.PureComponent { render() { const { thumbnail, formDisabled, uploadThumbnailStatus: status, openModal, updatePublishForm, thumbnailPath, resetThumbnailStatus, } = this.props; return (
{status === STATUSES.API_DOWN || status === STATUSES.MANUAL ? ( updatePublishForm({ thumbnail: e.target.value })} /> ) : (
{(status === STATUSES.READY || status === STATUSES.COMPLETE) && ( openModal({ id: MODALS.CONFIRM_THUMBNAIL_UPLOAD }, { path })} /> )} {status === STATUSES.COMPLETE && (

Upload complete. View it{' '}

)}
)}
{status === STATUSES.READY && (
{status === STATUSES.IN_PROGRESS &&

{__('Uploading thumbnail')}...

}
); } } export default SelectThumbnail;