fix(docs-infra): display value type in CLI pages (#63211)

The value type was not being displayed when a value had an enum, which was misleading. This change ensures the value type is always shown, so users know whether to expect a single value or an array of values.

PR Close #63211
This commit is contained in:
Alan Agius
2025-08-18 07:28:35 +00:00
committed by Kristiyan Kostadinov
parent c714426963
commit c7440dddef
@@ -24,14 +24,16 @@ export function CliCard(props: {card: CliCardRenderable}) {
{item.aliases?.map((alias) => (
<div class="docs-reference-option-aliases">
<span>Alias</span>
<code>{alias} </code>
<code>{alias}</code>
</div>
))}
</div>
<div dangerouslySetInnerHTML={{__html: item.description}}></div>
</div>
<div class="docs-reference-type-and-default">
{/* Display the enum values if there are some, else the type expected for the option */}
{/* Display the type expected for the option and the enum values if there are some. */}
<span>Value Type</span>
<code>{item.type}</code>
{item.enum ? (
<>
<span>Allowed Values</span>
@@ -45,10 +47,7 @@ export function CliCard(props: {card: CliCardRenderable}) {
</span>
</>
) : (
<>
<span>Value Type</span>
<code>{item.type}</code>
</>
<></>
)}
{/* Default Value */}
{item.default !== undefined ? <span>Default</span> : <></>}