diff --git a/apps/user/.env.template b/apps/user/.env.template index e061a1b..220084d 100644 --- a/apps/user/.env.template +++ b/apps/user/.env.template @@ -5,6 +5,11 @@ NEXT_PUBLIC_DEFAULT_LANGUAGE=en-US NEXT_PUBLIC_SITE_URL=https://user.ppanel.dev NEXT_PUBLIC_API_URL=https://api.ppanel.dev +# Home Page Settings +NEXT_PUBLIC_HOME_USER_COUNT=999 +NEXT_PUBLIC_HOME_SERVER_COUNT=999 +NEXT_PUBLIC_HOME_LOCATION_COUNT=999 + # Contact Email NEXT_PUBLIC_EMAIL=support@ppanel.dev # Community Links diff --git a/apps/user/components/main/stats.tsx b/apps/user/components/main/stats.tsx index 134276a..e71f899 100644 --- a/apps/user/components/main/stats.tsx +++ b/apps/user/components/main/stats.tsx @@ -1,8 +1,11 @@ 'use client'; -import { getStat } from '@/services/common/common'; +import { + NEXT_PUBLIC_HOME_LOCATION_COUNT, + NEXT_PUBLIC_HOME_SERVER_COUNT, + NEXT_PUBLIC_HOME_USER_COUNT, +} from '@/config/constants'; import { DotLottieReact } from '@lottiefiles/dotlottie-react'; -import { useQuery } from '@tanstack/react-query'; import LocationsLittie from '@workspace/ui/lotties/locations.json'; import ServersLottie from '@workspace/ui/lotties/servers.json'; import UsersLottie from '@workspace/ui/lotties/users.json'; @@ -13,31 +16,20 @@ import { useEffect, useState } from 'react'; export function Stats() { const t = useTranslations('index'); - const { data } = useQuery({ - queryKey: ['getStat'], - queryFn: async () => { - const { data } = await getStat({ - skipErrorHandler: true, - }); - return data.data; - }, - refetchOnWindowFocus: false, - }); - const list = [ { name: t('users'), - number: data?.user || 999, + number: NEXT_PUBLIC_HOME_USER_COUNT, icon: , }, { name: t('servers'), - number: data?.server || 30, + number: NEXT_PUBLIC_HOME_SERVER_COUNT, icon: , }, { name: t('locations'), - number: data?.country || 10, + number: NEXT_PUBLIC_HOME_LOCATION_COUNT, icon: , }, ];