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, }) => { const styles = useSpring({ from: { width: '0%' }, to: { width: `${progress}%` }, reset: true, immediate: reduceMotion, }); if (!active) { return null; } let message; if (isProcessing) { message = ( ); } else { message = ( ); } return (
{message}
); };