"use client"; import { useTranslations } from "next-intl"; import { DetailField, SectionHeader } from "../../../../../components"; import { Modules } from "../../../../../core"; import { usePageUrlGenerator } from "../../../../../hooks"; import { Badge, Link } from "../../../../../shadcnui"; import { formatCurrency, formatInterval } from "../../../components/utils/currency"; import { usePriceContext } from "../../../contexts/PriceContext"; export function PriceDetails() { const t = useTranslations(); const generateUrl = usePageUrlGenerator(); const { price } = usePriceContext(); if (!price) return null; const isRecurring = price.priceType === "recurring"; return (
{t("billing.admin.prices.title")}
{price.product.name} ) : ( "—" ) } /> {price.active ? ( {t("billing.admin.prices.status.active")} ) : ( {t("billing.admin.prices.status.archived")} )} {price.isTrial && {t("billing.admin.prices.badge.trial")}} } /> {formatCurrency(price.unitAmount, price.currency)}} /> {isRecurring && ( {price.recurring?.intervalCount ?? 1}} /> )} {isRecurring && ( )}
{t("billing.admin.prices.fields.platformFeatures")}
{price.token ?? "—"}} /> {price.stripePriceId}} /> 0 ? (
    {price.features.map((feature) => (
  • {feature}
  • ))}
) : ( "—" ) } /> 0 ? ( {price.priceFeatures.map((feature) => ( {feature.name} ))} ) : ( "—" ) } />
); }