"use client"; import { useTranslations } from "next-intl"; import { useState } from "react"; import { authClient } from "@/lib/auth-client"; import { TOPUP_PRODUCTS } from "@/lib/polar-products"; import { toast } from "@/lib/toast"; export function TopupPanel() { const t = useTranslations('toasts'); const [liveMessage, setLiveMessage] = useState(""); async function handleTopup(polarProductId: string) { setLiveMessage(t('billing.redirectingToCheckoutTitle')); toast.info( t('billing.redirectingToCheckoutTitle'), t('billing.redirectingToCheckoutDesc'), ); await authClient.checkout({ products: [polarProductId] }); } return (

Quick top-up

{TOPUP_PRODUCTS.map((product) => ( ))}

Angezeigt werden nur kaufbare Top-up Pakete aus der serverseitigen Polar-Produktkonfiguration.

{liveMessage}

); }