future tier plans to payment

This commit is contained in:
rgrgogu
2026-07-31 02:27:17 +08:00
parent cf6e6fc54c
commit 44d1fd2931
5 changed files with 123 additions and 29 deletions
@@ -23,7 +23,9 @@ export default function PlanComparisonTable({ plans, myTier, tierMap, fmtCurrenc
{plans.map((plan) => {
const { label, cls } = resolveTierBadge(plan.tier, tierMap);
const Icon = LucideIcons[tierMap[plan.tier]?.badge_icon] ?? Tag;
const isCurrent = myTier?.tier === plan.tier && myTier?.status === "active";
// A user can hold more than one active tier concurrently — check
// membership in the full active set, not just the best one.
const isCurrent = (myTier?.active_tiers ?? []).some((t) => t.tier === plan.tier);
return (
<th key={plan.plan_id} className="p-4 text-center align-bottom min-w-[160px]">
<div className="flex flex-col items-center gap-2">
@@ -74,7 +76,9 @@ export default function PlanComparisonTable({ plans, myTier, tierMap, fmtCurrenc
<tr>
<td className="p-4" />
{plans.map((plan) => {
const isCurrent = myTier?.tier === plan.tier && myTier?.status === "active";
// A user can hold more than one active tier concurrently — check
// membership in the full active set, not just the best one.
const isCurrent = (myTier?.active_tiers ?? []).some((t) => t.tier === plan.tier);
return (
<td key={plan.plan_id} className="p-4 text-center">
<Button