Skip to content

Commit 624bf4a

Browse files
committed
refactor: apply review suggestions to subscription display
1 parent cad780d commit 624bf4a

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

frontend/src/components/settings/subscription-display.tsx

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ interface SubscriptionDisplayProps {
1616
onManageSubscription: () => void;
1717
}
1818

19-
function getPlanDescription(plan: Plan): string {
20-
if (plan === Plan.Free) {
21-
return "Basic features for small teams";
22-
}
23-
return "Advanced features for growing organizations";
24-
}
25-
2619
function ActionButton({
2720
plan,
2821
onManageSubscription,
@@ -32,12 +25,12 @@ function ActionButton({
3225
}) {
3326
if (plan === Plan.Free) {
3427
return (
35-
<Link href="/pricing">
36-
<Button className="gap-2">
28+
<Button asChild className="gap-2">
29+
<Link href="/pricing">
3730
<BsStars className="h-4 w-4" />
3831
Upgrade
39-
</Button>
40-
</Link>
32+
</Link>
33+
</Button>
4134
);
4235
}
4336

@@ -49,21 +42,6 @@ function ActionButton({
4942
);
5043
}
5144

52-
function SupportLink({ plan }: { plan: Plan }) {
53-
if (plan === Plan.Free) {
54-
return null;
55-
}
56-
57-
return (
58-
<p className="text-sm text-muted-foreground mt-2">
59-
Need help with your subscription?{" "}
60-
<Link href="/support" className="text-primary hover:underline">
61-
Contact support
62-
</Link>
63-
</p>
64-
);
65-
}
66-
6745
function SubscriptionContent({
6846
subscription,
6947
onManageSubscription,
@@ -81,15 +59,16 @@ function SubscriptionContent({
8159
" Plan"}
8260
</p>
8361
<p className="text-sm text-muted-foreground">
84-
{getPlanDescription(subscription.plan)}
62+
{subscription.plan === Plan.Free
63+
? "Basic features for small teams"
64+
: "Advanced features for growing organizations"}
8565
</p>
8666
</div>
8767
<ActionButton
8868
plan={subscription.plan}
8969
onManageSubscription={onManageSubscription}
9070
/>
9171
</div>
92-
<SupportLink plan={subscription.plan} />
9372
</div>
9473
);
9574
}

0 commit comments

Comments
 (0)