"use client"; import Statistic from "@/components/home/statistic"; import { AppStatistics } from "@ssr/common/types/backend/app-statistics"; import { useQuery } from "@tanstack/react-query"; import { kyFetch } from "@ssr/common/utils/utils"; import { Config } from "@ssr/common/config"; import { useEffect, useState } from "react"; type AppStatisticsProps = { /** * The app statistics. */ initialStatistics: AppStatistics; }; export function AppStats({ initialStatistics }: AppStatisticsProps) { const [statistics, setStatistics] = useState(initialStatistics); const { data } = useQuery({ queryKey: ["app-statistics"], queryFn: () => kyFetch(Config.apiUrl + "/statistics"), }); useEffect(() => { if (data) { setStatistics(data); } }, [data]); return (

Site Statistics

); }