// @flow import React from 'react'; import { THUMBNAIL_STATUSES, isNameValid } from 'lbry-redux'; import { INVALID_NAME_ERROR } from 'constants/claim'; type Props = { title: ?string, name: ?string, bid: ?string, bidError: ?string, editingURI: ?string, filePath: ?string, isStillEditing: boolean, uploadThumbnailStatus: string, }; function PublishFormErrors(props: Props) { const { name, title, bid, bidError, editingURI, filePath, isStillEditing, uploadThumbnailStatus } = props; // These are extra help // If there is an error it will be presented as an inline error as well return (
{!title &&
{__('A title is required')}
} {!name &&
{__('A URL is required')}
} {!isNameValid(name, false) && INVALID_NAME_ERROR} {!bid &&
{__('A deposit amount is required')}
} {bidError &&
{__('Please check your deposit amount.')}
} {uploadThumbnailStatus === THUMBNAIL_STATUSES.IN_PROGRESS && (
{__('Please wait for thumbnail to finish uploading')}
)} {editingURI && !isStillEditing && !filePath && (
{__('Please reselect a file after changing the LBRY URL')}
)}
); } export default PublishFormErrors;