bigbuffet-rw/app/soapbox/features/compose/components/upload-progress.tsx

27 lines
592 B
TypeScript
Raw Normal View History

2022-03-30 07:51:07 -07:00
import React from 'react';
import UploadProgress from 'soapbox/components/upload-progress';
import { useCompose } from 'soapbox/hooks';
2022-03-30 07:51:07 -07:00
interface IComposeUploadProgress {
composeId: string,
}
/** File upload progress bar for post composer. */
const ComposeUploadProgress: React.FC<IComposeUploadProgress> = ({ composeId }) => {
const compose = useCompose(composeId);
const active = compose.is_uploading;
const progress = compose.progress;
2022-03-30 07:51:07 -07:00
if (!active) {
return null;
}
return (
<UploadProgress progress={progress} />
2022-03-30 07:51:07 -07:00
);
};
export default ComposeUploadProgress;