|
|
@ -21,20 +21,26 @@ const DownloadBlock: React.FC<DownloadBlockProps> = ({
|
|
|
|
<div
|
|
|
|
<div
|
|
|
|
className="h-8 transition-all duration-200 ease-in-out bg-indigo-600"
|
|
|
|
className="h-8 transition-all duration-200 ease-in-out bg-indigo-600"
|
|
|
|
style={{
|
|
|
|
style={{
|
|
|
|
width: `${Math.round(
|
|
|
|
width: `${
|
|
|
|
|
|
|
|
downloadItem.size
|
|
|
|
|
|
|
|
? Math.round(
|
|
|
|
((downloadItem.size - downloadItem.sizeLeft) /
|
|
|
|
((downloadItem.size - downloadItem.sizeLeft) /
|
|
|
|
downloadItem.size) *
|
|
|
|
downloadItem.size) *
|
|
|
|
100
|
|
|
|
100
|
|
|
|
)}%`,
|
|
|
|
)
|
|
|
|
|
|
|
|
: 0
|
|
|
|
|
|
|
|
}%`,
|
|
|
|
}}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div className="absolute inset-0 flex items-center justify-center w-full h-6 text-xs">
|
|
|
|
<div className="absolute inset-0 flex items-center justify-center w-full h-6 text-xs">
|
|
|
|
<span>
|
|
|
|
<span>
|
|
|
|
{Math.round(
|
|
|
|
{downloadItem.size
|
|
|
|
|
|
|
|
? Math.round(
|
|
|
|
((downloadItem.size - downloadItem.sizeLeft) /
|
|
|
|
((downloadItem.size - downloadItem.sizeLeft) /
|
|
|
|
downloadItem.size) *
|
|
|
|
downloadItem.size) *
|
|
|
|
100
|
|
|
|
100
|
|
|
|
)}
|
|
|
|
)
|
|
|
|
|
|
|
|
: 0}
|
|
|
|
%
|
|
|
|
%
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|