Skip to content

Commit caa463b

Browse files
authored
[Docs Site] Add check for plan-level info in ProductFeatures (#18774)
1 parent 7074db6 commit caa463b

File tree

1 file changed

+65
-39
lines changed

1 file changed

+65
-39
lines changed

src/components/ProductFeatures.astro

Lines changed: 65 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const entries = Object.entries(plan);
3838
<a href={value.link}>{value.title}</a>
3939
</p>
4040
)}
41-
{Object.entries(value.properties).map(([_, value]: [string, any]) => (
41+
{Object.values(value.properties).map((value: any) => (
4242
<p>
4343
<strong
4444
set:html={marked.parseInline(
@@ -51,52 +51,78 @@ const entries = Object.entries(plan);
5151
<p>{value.summary}</p>
5252
)}
5353
<ul>
54-
<li>
55-
<strong>Free: </strong>
56-
<Fragment
57-
set:html={marked.parseInline(value.free.toString())}
58-
/>
59-
</li>
54+
{value.free && (
55+
<li>
56+
<strong>Free: </strong>
57+
<Fragment
58+
set:html={marked.parseInline(value.free.toString())}
59+
/>
60+
</li>
61+
)}
6062
{additional_descriptions && (
63+
<>
64+
{value.lite ||
65+
(value.free && (
66+
<li>
67+
<strong>Lite: </strong>
68+
{value.lite ? (
69+
<Fragment
70+
set:html={marked.parseInline(value.lite.toString())}
71+
/>
72+
) : (
73+
<Fragment
74+
set:html={marked.parseInline(value.free.toString())}
75+
/>
76+
)}
77+
</li>
78+
))}
79+
</>
80+
)}
81+
{value.pro && (
6182
<li>
62-
<strong>Lite: </strong>
63-
{value.lite ? (
64-
<Fragment
65-
set:html={marked.parseInline(value.lite.toString())}
66-
/>
67-
) : (
68-
<Fragment
69-
set:html={marked.parseInline(value.free.toString())}
70-
/>
71-
)}
83+
<strong>Pro: </strong>
84+
<Fragment
85+
set:html={marked.parseInline(value.pro.toString())}
86+
/>
7287
</li>
7388
)}
74-
<li>
75-
<strong>Pro: </strong>
76-
<Fragment set:html={marked.parseInline(value.pro.toString())} />
77-
</li>
7889
{additional_descriptions && (
90+
<>
91+
{value.pro_plus ||
92+
(value.pro && (
93+
<li>
94+
<strong>Pro Plus: </strong>
95+
{value.pro_plus ? (
96+
<Fragment
97+
set:html={marked.parseInline(
98+
value.pro_plus.toString(),
99+
)}
100+
/>
101+
) : (
102+
<Fragment
103+
set:html={marked.parseInline(value.pro.toString())}
104+
/>
105+
)}
106+
</li>
107+
))}
108+
</>
109+
)}
110+
{value.biz && (
111+
<li>
112+
<strong>Business: </strong>
113+
<Fragment
114+
set:html={marked.parseInline(value.biz.toString())}
115+
/>
116+
</li>
117+
)}
118+
{value.ent && (
79119
<li>
80-
<strong>Pro Plus: </strong>
81-
{value.pro_plus ? (
82-
<Fragment
83-
set:html={marked.parseInline(value.pro_plus.toString())}
84-
/>
85-
) : (
86-
<Fragment
87-
set:html={marked.parseInline(value.pro.toString())}
88-
/>
89-
)}
120+
<strong>Enterprise: </strong>
121+
<Fragment
122+
set:html={marked.parseInline(value.ent.toString())}
123+
/>
90124
</li>
91125
)}
92-
<li>
93-
<strong>Business: </strong>
94-
<Fragment set:html={marked.parseInline(value.biz.toString())} />
95-
</li>
96-
<li>
97-
<strong>Enterprise: </strong>
98-
<Fragment set:html={marked.parseInline(value.ent.toString())} />
99-
</li>
100126
</ul>
101127
</p>
102128
))}

0 commit comments

Comments
 (0)