import * as React from 'react'; import { FormattedMessage, useIntl } from 'react-intl'; import { Button } from '@box/blueprint-web'; import messages from '../common/messages'; import { ERROR_CODE_UPLOAD_FILE_LIMIT } from '../../constants'; import './Footer.scss'; type Props = { errorCode?: string, fileLimit: number, hasFiles: boolean, isDone: boolean, isLoading: boolean, onCancel: any, onClose?: any, onUpload: any, }; const Footer = ({ isLoading, hasFiles, errorCode, onCancel, onClose, onUpload, fileLimit, isDone }: Props) => { const intl = useIntl(); const isCloseButtonDisabled = hasFiles; const isCancelButtonDisabled = !hasFiles || isDone; const isUploadButtonDisabled = !hasFiles; let message; switch (errorCode) { case ERROR_CODE_UPLOAD_FILE_LIMIT: message = ; break; default: // ignore } return (
{onClose ? ( ) : null}
{message &&
{message}
}
); }; export default Footer;