import React, { useEffect, ReactElement } from "react"; import { getDownloadProgress, getBundlesForComic, } from "../actions/airdcpp.actions"; import { useDispatch, useSelector } from "react-redux"; import { RootState } from "threetwo-ui-typings"; import { isNil, map } from "lodash"; import prettyBytes from "pretty-bytes"; import dayjs from "dayjs"; import ellipsize from "ellipsize"; interface IDownloadsPanelProps { data: any; comicObjectId: string; } export const DownloadsPanel = ( props: IDownloadsPanelProps, ): ReactElement | null => { const downloadProgressTick = useSelector( (state: RootState) => state.airdcpp.downloadProgressData, ); const bundles = useSelector((state: RootState) => { return state.airdcpp.bundles; }); console.log("BANDYA", bundles); const dispatch = useDispatch(); useEffect(() => { dispatch(getBundlesForComic(props.comicObjectId)); dispatch(getDownloadProgress(props.comicObjectId)); }, [dispatch]); const ProgressTick = (props) => { console.log("tick", props); return (
| Filename | Size | Download Time |
|---|---|---|
{ellipsize(bundle.name, 58)}{bundle.target} |
{prettyBytes(bundle.size)} | {dayjs .unix(bundle.time_finished) .format("h:mm on ddd, D MMM, YYYY")} |