// Invoices — URL `/invoices`. Lists the tenant's invoice history live from // `billing.invoices`. Each row's amount/status is shown; "View" / "PDF" link OUT // to the provider's own hosted pages (`hostedUrl` / `pdfUrl`) — the portal never // renders an invoice document itself. import type { ReactNode } from 'react' import type { PageMeta } from '@voltro/web' import { useSubscription } from '@voltro/client' import { T, useLocale } from '@voltro/i18n' import { getCatalog } from '../../../locales/index' import { formatMoney, type Invoice } from '../../../lib/api' export const renderMode = 'ssr' as const export const meta = ({ locale }: { readonly locale: string }): PageMeta => ({ title: getCatalog(locale)['meta.invoices.title'], }) export default function Invoices(): ReactNode { const locale = useLocale() const { data } = useSubscription<{ invoices: ReadonlyArray }>('app', 'billing.invoices') const invoices = data?.invoices ?? [] return (

{invoices.length === 0 ? (

) : ( )}
) }