Update pricing display logic in pricing-table

The commit refactors how pricing is displayed in the pricing-table component. It now displays the plan label if one exists and defaults to 'billing:custom' otherwise. This provides more flexibility and accuracy in displaying plan details.
This commit is contained in:
gbuomprisco
2024-07-18 09:43:53 +02:00
parent 1876bbd9e4
commit 7f1b03f4dc

View File

@@ -209,9 +209,13 @@ function PricingItem(
<div className={'flex flex-col space-y-1'}>
<Price>
{lineItem
? formatCurrency(props.product.currency, lineItem.cost)
: (props.plan.label ?? <Trans i18nKey={'billing:custom'} />)}
{lineItem ? (
formatCurrency(props.product.currency, lineItem.cost)
) : props.plan.label ? (
<Trans i18nKey={props.plan.label} defaults={props.plan.label} />
) : (
<Trans i18nKey={'billing:custom'} />
)}
</Price>
<If condition={props.plan.name}>