diff --git a/frontend/src/app/[lang]/dashboard/page.tsx b/frontend/src/app/[lang]/dashboard/page.tsx index df93d67..2f368cb 100644 --- a/frontend/src/app/[lang]/dashboard/page.tsx +++ b/frontend/src/app/[lang]/dashboard/page.tsx @@ -3,14 +3,14 @@ import { useQuery } from '@tanstack/react-query'; import type { ReactNode } from 'react'; import { Link } from '@/i18n/Link'; -import { useT } from '@/i18n/I18nProvider'; +import { useT, useLocale } from '@/i18n/I18nProvider'; import type { Dictionary } from '@/i18n/dictionaries/fa'; import api from '@/lib/api'; import { useAuthStore } from '@/lib/store'; import type { Application } from '@/types'; import { Rocket, Package, Circle, Hexagon, Wallet, Clock, Database, Plus } from 'lucide-react'; import type { ResourceCredit } from '@/types'; -import { formatExpiresAtLocal } from '@/lib/format-utils'; +import { formatExpiresAtLocal, formatRemainingForLocale } from '@/lib/format-utils'; import { managedServiceTypeLabel } from '@/lib/optional-service-defaults'; import { filterApplications, filterManagedServices } from '@/lib/product-type'; @@ -65,6 +65,7 @@ function serviceSubtitle(app: Application): string { export default function DashboardPage() { const t = useT(); + const locale = useLocale(); const h = t.dashboard.home; const user = useAuthStore((s) => s.user); @@ -116,10 +117,10 @@ export default function DashboardPage() {

- {h.remaining.replace('{label}', credit.remainingLabel)} + {h.remaining.replace('{label}', formatRemainingForLocale(credit.expiresAt, locale))}

- {h.expires.replace('{date}', formatExpiresAtLocal(credit.expiresAt))} + {h.expires.replace('{date}', formatExpiresAtLocal(credit.expiresAt, locale))}