bigbuffet-rw/app/soapbox/features/compose/components/upload-progress.tsx
marcin mikolajczak 6cce0a0291 Introduce useCompose hook
Signed-off-by: marcin mikolajczak <git@mkljczk.pl>
2022-09-14 20:01:44 +02:00

26 lines
592 B
TypeScript

import React from 'react';
import UploadProgress from 'soapbox/components/upload-progress';
import { useCompose } from 'soapbox/hooks';
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;
if (!active) {
return null;
}
return (
<UploadProgress progress={progress} />
);
};
export default ComposeUploadProgress;