- {
- statusMessages.map(({ title, messages }) => {
- return (
-
- {title}
-
- {
- messages.map((message) => {
- return (
- -
- {message}
-
- );
- })
- }
-
-
- );
- })
- }
+ {statusMessages.map(({ title, messages }) => {
+ return (
+
+ {title}
+
+ {messages.map((message) => {
+ return - {message}
;
+ })}
+
+
+ );
+ })}
);
}
-function QueueStatus(props) {
+interface QueueStatusProps {
+ sourceTitle: string;
+ status: string;
+ trackedDownloadStatus?: QueueTrackedDownloadStatus;
+ trackedDownloadState?: QueueTrackedDownloadState;
+ statusMessages?: StatusMessage[];
+ errorMessage?: string;
+ position: TooltipPosition;
+ canFlip?: boolean;
+}
+
+function QueueStatus(props: QueueStatusProps) {
const {
sourceTitle,
status,
- trackedDownloadStatus,
- trackedDownloadState,
- statusMessages,
+ trackedDownloadStatus = 'ok',
+ trackedDownloadState = 'downloading',
+ statusMessages = [],
errorMessage,
position,
- canFlip
+ canFlip = false,
} = props;
const hasWarning = trackedDownloadStatus === 'warning';
@@ -115,7 +123,8 @@ function QueueStatus(props) {
if (status === 'warning') {
iconName = icons.DOWNLOADING;
iconKind = kinds.WARNING;
- const warningMessage = errorMessage || translate('CheckDownloadClientForDetails');
+ const warningMessage =
+ errorMessage || translate('CheckDownloadClientForDetails');
title = translate('DownloadWarning', { warningMessage });
}
@@ -133,35 +142,17 @@ function QueueStatus(props) {
return (