/* eslint-disable */ "use client"; import Link from "next/link"; import prettyBytes from "pretty-bytes"; import { HTMLAttributes } from "react"; import { useTranslation } from "react-i18next"; import Button from "@/lib/components/ui/Button"; import { UserStats } from "@/lib/types/User"; import { cn } from "@/lib/utils"; import { ApiKeyConfig } from "./ApiKeyConfig"; import { BrainConsumption } from "./BrainConsumption"; import { DateComponent } from "./Date"; import BrainSpaceChart from "./Graphs/BrainSpaceChart"; import { RequestsPerDayChart } from "./Graphs/RequestsPerDayChart"; export const UserStatistics = (userStats: UserStats): JSX.Element => { const { email, current_brain_size, max_brain_size, date, requests_stats } = userStats; const { t } = useTranslation(["translation", "user"]); return ( <>

{t("title", { user: email.split("@")[0], ns: "user" })}

{email}

{/* The last element corresponds to today's request_count */} {t("requestsCount", { count: requests_stats.at(-1)?.daily_requests_count, ns: "user", })}

{t("brainSize", { ns: "user" })}

{/* How much brain space is left */} {prettyBytes(max_brain_size - current_brain_size, { binary: true, })} /{prettyBytes(max_brain_size - 0, { binary: true })}

); }; const UserStatisticsCard = ({ children, className, }: HTMLAttributes) => { return (
{children}
); }; export default UserStatistics;