+ {Object.values(statuses).map((status) => {
+ const bookName =
+ status.bookId && status.bookId > 0 ?
+ `Book ${status.bookId}`
+ : strings.allBooksLabel;
+ const isComplete = status.status === JobStatus.Complete;
+ const isFailed = status.status === JobStatus.Failed;
+ const statusLabel =
+ strings.statusLabels[status.status] ?? status.status;
+ return (
+
+
+
+
+ {status.bookId ? `Book ${status.bookId}` : "Book"}
+
+ {bookName}
+
+
+ {statusLabel}
+
+
+ {status.downloadUrl && (
+
+
+ {status.expiresAt && (
+
+ {strings.expiresLabel}:{" "}
+ {new Date(status.expiresAt).toLocaleString()}
+
+ )}
+
+ )}
+ {isFailed && (
+
+ {status.error === "missing" ?
+ strings.missingLabel
+ : strings.failedLabel}
+
+ )}
+ {!isComplete && !isFailed && (
+
+ {strings.generatingLabel}
+
+ )}
+