import React from 'react'; import {Link, Route, Routes} from "react-router"; import { ErrorMessage, humanFileSize, humanNumber, mimetypeColor, PageContainer, toLocaleString, useTitle } from "./Common"; import {Header, Label, Loading, Panel, Statistic, StatisticGroup, TextInput} from "./ui"; import {useStatistics} from "../hooks/customHooks"; import {CalculatorsPage} from "./Calculators"; function StatisticsPage() { useTitle('Statistics'); const {statistics} = useStatistics(); if (statistics === undefined) { return <>
Statistics
Failed to fetch statistics } if (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 <>
Statistics
Files
Tags
Database
; } return <>
Statistics
; } export function MoreRoute(props) { return }/> }/> } /** * A text input with a colored tag attached to its leading (or trailing) edge. * Replaces Semantic's `} labelPosition=.../>`. */ export function ColoredInput({name, value, label, color, labelPosition = 'left', fluid, style, ...props}) { const labelNode = label ? : null; return
{labelNode && labelPosition === 'left' && labelNode} {labelNode && labelPosition !== 'left' && labelNode}
}