/** * @file Statistics panel component showing player progress and all-time stats. * @copyright nhcarrigan * @license Naomi's Public License * @author Naomi Carrigan */ /* eslint-disable react/no-multi-comp -- Sub-component is tightly coupled to the panel */ /* eslint-disable max-lines-per-function -- Complex component with many render paths */ /* eslint-disable react/require-default-props -- TypeScript optional props with default parameters are sufficient */ import { useGame } from "../../context/gameContext.js"; import { PRESTIGE_UPGRADES } from "../../data/prestigeUpgrades.js"; import type { JSX } from "react"; const formatDate = (timestamp: number): string => { return new Date(timestamp).toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric", }); }; interface StatCardProperties { readonly icon: string; readonly label: string; readonly value: string; readonly sub?: string | undefined; } /** * Renders a single statistic card. * @param props - The stat card properties. * @param props.icon - The icon to display. * @param props.label - The label for the stat. * @param props.value - The value to display. * @param props.sub - Optional sub-label. * @returns The JSX element. */ const StatCard = ({ icon, label, value, sub = undefined, }: StatCardProperties): JSX.Element => { return (
{"Loading..."}