import { Box, Grid } from '@material-ui/core' import { ReactElement } from 'react' import { ArrowLeft, Check, Layers, PlusSquare, X } from 'react-feather' import { DocumentationText } from '../../components/DocumentationText' import ExpandableListItemActions from '../../components/ExpandableListItemActions' import { SwarmButton } from '../../components/SwarmButton' interface Props { step: number onUpload: () => void onCancel: () => void onGoBack: () => void onProceed: () => void isUploading: boolean hasStamp: boolean uploadLabel: string stampMode: 'BUY' | 'SELECT' setStampMode: (mode: 'BUY' | 'SELECT') => void } export function UploadActionBar({ step, onUpload, onCancel, onGoBack, onProceed, isUploading, hasStamp, uploadLabel, stampMode, setStampMode, }: Props): ReactElement { if (step === 0) { return ( <> Add Postage Stamp Cancel You need a postage stamp to upload. ) } if (step === 1) { return ( {stampMode === 'SELECT' && ( Proceed With Selected Stamp )} Back To Preview setStampMode(stampMode === 'BUY' ? 'SELECT' : 'BUY')} iconType={stampMode === 'BUY' ? Layers : PlusSquare} > {stampMode === 'BUY' ? 'Use Existing Stamp' : 'Buy New Stamp'} ) } if (step === 2) { return ( {uploadLabel} Change Postage Stamp ) } return <> }