import { FormattedMessage } from 'react-intl'; import { animated, useSpring } from '@react-spring/web'; import UploadFileIcon from '@/material-icons/400-24px/upload_file.svg?react'; import { Icon } from 'mastodon/components/icon'; import { reduceMotion } from 'mastodon/initial_state'; interface UploadProgressProps { active: boolean; progress: number; isProcessing?: boolean; } export const UploadProgress: React.FC = ({ active, progress, isProcessing = false, }) => { const styles = useSpring({ from: { width: '0%' }, to: { width: `${progress}%` }, immediate: reduceMotion || !active, // If this is not active, update the UI immediately. }); if (!active) { return null; } return (
{isProcessing ? ( ) : ( )}
); };