multiple file download with progress bar and percentage

This commit is contained in:
spencerwooo
2021-12-17 23:16:18 +08:00
parent 93376e071e
commit e20a2f52a5
4 changed files with 61 additions and 27 deletions
+3 -1
View File
@@ -11,7 +11,7 @@ enum PlayerState {
Paused,
}
export const AudioPreview: FunctionComponent<{ file: any }> = ({ file }) => {
const AudioPreview: FunctionComponent<{ file: any }> = ({ file }) => {
const [playerStatus, setPlayerStatus] = useState(PlayerState.Loading)
return (
@@ -79,3 +79,5 @@ export const AudioPreview: FunctionComponent<{ file: any }> = ({ file }) => {
</>
)
}
export default AudioPreview
+4 -2
View File
@@ -6,9 +6,9 @@ import { useClipboard } from 'use-clipboard-copy'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import toast, { Toaster } from 'react-hot-toast'
import { getBaseUrl } from "../../utils/getBaseUrl"
import { getBaseUrl } from '../../utils/getBaseUrl'
export const VideoPreview: FunctionComponent<{ file: any }> = ({ file }) => {
const VideoPreview: FunctionComponent<{ file: any }> = ({ file }) => {
const { asPath } = useRouter()
const clipboard = useClipboard()
@@ -81,3 +81,5 @@ export const VideoPreview: FunctionComponent<{ file: any }> = ({ file }) => {
</>
)
}
export default VideoPreview