@props([
'plan' => null,
'size' => 'default', // default | lg
'showDuration' => true,
])
@php
use App\Support\PriceFormatter;
$price = $plan?->price;
$sizeClass = $size === 'lg' ? 'text-3xl font-bold tracking-tight' : 'text-sm font-semibold';
@endphp
@if($price)
@if($plan->hasSalePrice())
merge(['class' => 'space-y-1']) }}>
{{ PriceFormatter::formatUsd($price->amount) }}
@if($showDuration)
{{ PriceFormatter::formatPlanPrice($plan->effective_price, $plan) }}
@else
{{ PriceFormatter::formatUsd($plan->effective_price) }}
@endif
@if($plan->discount_percentage)
{{ __('pages/plans.pricing.discount_off', ['percent' => $plan->discount_percentage]) }}
@endif
@else
@if($showDuration)
{{ PriceFormatter::formatPlanPrice($price->amount, $plan) }}
@else
{{ PriceFormatter::formatUsd($price->amount) }}
@endif
@endif
@else
{{ __('pages/common.empty') }}
@endif