(props: { readonly placement: Placement; readonly masked?: boolean })
| 121 | // --------------------------------------------------------------------------- |
| 122 | |
| 123 | export function PlacementLine(props: { readonly placement: Placement; readonly masked?: boolean }) { |
| 124 | const { placement, masked = true } = props; |
| 125 | const lead = |
| 126 | placement.carrier === "header" |
| 127 | ? `${placement.name || "Authorization"}: ` |
| 128 | : placement.carrier === "env" |
| 129 | ? `${placement.name || "TOKEN"}=` |
| 130 | : `?${placement.name || "api_key"}=`; |
| 131 | // Plain inline (not inline-flex): flex trims the whitespace at the edges of |
| 132 | // each child, which would drop the space after "Authorization:" and the |
| 133 | // trailing space carried by a prefix like "Bearer ", rendering |
| 134 | // "Authorization:Bearer••••••". whitespace-pre-wrap keeps those spaces while |
| 135 | // still allowing the line to wrap. wrap-anywhere lets an unbroken value (a |
| 136 | // long API key pasted as the prefix) break mid-token — without it the line's |
| 137 | // min-content width is the whole key and it stretches the dialog off-screen. |
| 138 | return ( |
| 139 | <span className="wrap-anywhere whitespace-pre-wrap font-mono text-xs text-muted-foreground"> |
| 140 | {lead} |
| 141 | {placement.prefix ? ( |
| 142 | <span className="text-muted-foreground/60">{placement.prefix}</span> |
| 143 | ) : null} |
| 144 | <span className="tracking-widest text-primary">{masked ? "••••••" : "value"}</span> |
| 145 | </span> |
| 146 | ); |
| 147 | } |
| 148 | |
| 149 | // --------------------------------------------------------------------------- |
| 150 | // Catalog-descriptor → client AuthMethod conversion. |
nothing calls this directly
no outgoing calls
no test coverage detected