import * as React from 'react';
import { FormattedMessage, useIntl } from 'react-intl';
import { Button } from '@box/blueprint-web';
import { ERROR_CODE_UPLOAD_FILE_LIMIT } from '../../constants';
import messages from '../common/messages';
import './Footer.scss';
export interface FooterProps {
errorCode?: string;
fileLimit: number;
hasFiles: boolean;
isDone: boolean;
isLoading: boolean;
onCancel: () => void;
onClose?: () => void;
onUpload: () => void;
}
const Footer = ({ isLoading, hasFiles, errorCode, onCancel, onClose, onUpload, fileLimit, isDone }: FooterProps) => {
const { formatMessage } = useIntl();
const isCloseButtonDisabled = hasFiles;
const isCancelButtonDisabled = !hasFiles || isDone;
const isUploadButtonDisabled = !hasFiles;
let message;
if (errorCode === ERROR_CODE_UPLOAD_FILE_LIMIT) {
message =