import React from 'react';
import {Link, Route, Routes} from "react-router";
import {
ErrorMessage,
humanFileSize,
humanNumber,
mimetypeColor,
PageContainer,
toLocaleString,
useTitle
} from "./Common";
import {Header, Loading, Panel, Statistic, StatisticGroup} from "./ui";
import {useStatistics} from "../hooks/customHooks";
import {CalculatorsPage} from "./Calculators";
import {BookmarksPage} from "./Bookmarks";
// `statistics` follows useStatistics: null = pending, undefined = fetch failed.
export function StatisticsPage() {
useTitle('Statistics');
const {statistics} = useStatistics();
if (statistics === undefined) {
return <>
Failed to fetch statistics
>
}
if (statistics && statistics['global_statistics']) {
let {global_statistics, file_statistics} = statistics;
const {
archive_count,
audio_count,
ebook_count,
image_count,
pdf_count,
total_count,
video_count,
zip_count,
total_size,
tagged_files,
tagged_zims,
tags_count,
} = file_statistics;
const {db_size} = global_statistics;
return <>
>;
}
return <>
>;
}
export function MoreRoute(props) {
return
}/>
}/>
}/>
}