MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / PlacementLine

Function PlacementLine

packages/react/src/lib/auth-placements.tsx:123–147  ·  view source on GitHub ↗
(props: { readonly placement: Placement; readonly masked?: boolean })

Source from the content-addressed store, hash-verified

121// ---------------------------------------------------------------------------
122
123export 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.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected