🕶Added visibility guards to volumes, stats and wanted on dashboard

This commit is contained in:
2026-03-09 23:11:15 -04:00
parent ba1b5bb965
commit 4e2cad790b
3 changed files with 7 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ interface LibraryStatisticsProps {
* Returns `null` when `stats` is absent or the statistics array is empty.
*/
export const LibraryStatistics = ({ stats }: LibraryStatisticsProps): ReactElement | null => {
if (!stats) return null;
if (!stats || !stats.totalDocuments) return null;
const facet = stats.statistics?.[0];
if (!facet) return null;