|
2 | 2 |
|
3 | 3 | import type { Episode as TvMazeEpisode, Show as TvMazeShow } from "tvmaze-wrapper-ts"; |
4 | 4 | import { useEffect, useState } from "react"; |
5 | | -import { DownloadIcon, TriangleIcon } from "lucide-react"; |
| 5 | +import { CircleDashedIcon, CircleIcon, DownloadIcon, TriangleIcon } from "lucide-react"; |
6 | 6 | import { useLocale, useTranslations } from "next-intl"; |
7 | 7 |
|
8 | 8 | import type { DownloadedEpisode, DownloadStatusType } from "@/lib/types"; |
@@ -101,25 +101,37 @@ export function EpisodeDownloadIndicator({ |
101 | 101 | "text-accent2 cursor-help": downloadStatus === DownloadStatus.UNKNOWN, |
102 | 102 | })} |
103 | 103 | title={downloadTooltip} |
104 | | - style={{ minWidth: 20 }} |
| 104 | + style={{ |
| 105 | + minWidth: 20, |
| 106 | + transform: showProgress |
| 107 | + ? `rotate(${90 + (metadata?.progress ?? 0) * 180}deg)` |
| 108 | + : undefined, |
| 109 | + }} |
105 | 110 | onClick={downloadStatus === DownloadStatus.STOPPED ? startDownload : undefined} |
106 | 111 | > |
107 | 112 | {showProgress && ( |
108 | 113 | <div |
109 | | - className="absolute overflow-hidden" |
| 114 | + className="transition-width absolute overflow-hidden duration-300" |
110 | 115 | style={{ |
111 | 116 | width: `${100 * (metadata?.progress ?? 0)}%`, |
112 | 117 | }} |
113 | 118 | > |
114 | | - <DownloadIcon |
| 119 | + <CircleIcon |
115 | 120 | className={cn({ |
116 | 121 | "text-success": downloadStatus === DownloadStatus.PENDING, |
117 | 122 | "text-accent2": downloadStatus === DownloadStatus.VERIFYING, |
118 | 123 | })} |
119 | | - ></DownloadIcon> |
| 124 | + ></CircleIcon> |
120 | 125 | </div> |
121 | 126 | )} |
122 | | - <DownloadIcon /> |
| 127 | + {downloadStatus === DownloadStatus.FAILED || |
| 128 | + downloadStatus === DownloadStatus.UNKNOWN ? ( |
| 129 | + <CircleDashedIcon /> |
| 130 | + ) : showProgress ? ( |
| 131 | + <CircleIcon /> |
| 132 | + ) : ( |
| 133 | + <DownloadIcon /> |
| 134 | + )} |
123 | 135 | </button> |
124 | 136 | )} |
125 | 137 | {!showProgress && user != null && ( |
|
0 commit comments