// Overview — URL `/`. A glance at the account: the current plan (live from // `billing.subscription`), renewal date, and quick links into the deeper pages. import type { ReactNode } from 'react' import type { PageMeta } from '@voltro/web' import { useSubscription } from '@voltro/client' import { T, useT } from '@voltro/i18n' import { getCatalog } from '../../locales' import type { SubscriptionState } from '../../lib/api' export const renderMode = 'ssr' as const export const meta = ({ locale }: { readonly locale: string }): PageMeta => ({ title: getCatalog(locale)['meta.overview.title'], }) export default function Overview(): ReactNode { const { data } = useSubscription('app', 'billing.subscription') const sub = data?.subscription ?? null const freeLabel = useT('billing.plan.free') return (

{sub?.plan ?? freeLabel}
{sub?.status ?? '—'}
{sub?.currentPeriodEnd ? new Date(sub.currentPeriodEnd).toLocaleDateString() : '—'}
) }