Fixed: Progress bar for authors and books

This commit is contained in:
Bogdan
2024-02-12 00:04:45 +02:00
parent 0b924005ec
commit d659e86a7d
7 changed files with 48 additions and 32 deletions
@@ -16,8 +16,8 @@ function BookIndexProgressBar(props) {
detailedProgressBar
} = props;
const progress = bookCount ? bookFileCount / totalBookCount * 100 : 0;
const text = `${bookFileCount} / ${bookCount}`;
const progress = bookFileCount && bookCount ? (totalBookCount / bookCount) * 100 : 0;
const text = `${bookFileCount ? bookCount : 0} / ${totalBookCount}`;
return (
<ProgressBar
@@ -28,7 +28,11 @@ function BookIndexProgressBar(props) {
size={detailedProgressBar ? sizes.MEDIUM : sizes.SMALL}
showText={detailedProgressBar}
text={text}
title={translate('BookFileCountBookCountTotalTotalBookCountInterp', [bookFileCount, bookCount, totalBookCount])}
title={translate('BookProgressBarText', {
bookCount: bookFileCount ? bookCount : 0,
bookFileCount,
totalBookCount
})}
width={posterWidth}
/>
);