MCPcopy
hub / github.com/remix-run/react-router / render

Method render

packages/create-react-router/prompts-select.ts:173–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171 }
172
173 render() {
174 if (this.closed) return;
175 if (this.firstRender) this.out.write(cursor.hide);
176 else this.out.write(clear(this.outputText, this.out.columns));
177 super.render();
178
179 let outputText = [
180 "\n",
181 this.label,
182 " ",
183 this.msg,
184 this.done
185 ? ""
186 : this.hint
187 ? (this.out.columns < 80 ? "\n" + " ".repeat(8) : "") +
188 color.dim(` (${this.hint})`)
189 : "",
190 "\n",
191 ];
192
193 let prefix = " ".repeat(strip(this.label).length);
194
195 if (this.done) {
196 outputText.push(
197 `${prefix} `,
198 color.dim(`${this.choices[this.cursor]?.label}`),
199 );
200 } else {
201 outputText.push(
202 this.choices
203 .map((choice, i) =>
204 i === this.cursor
205 ? `${prefix} ${color.green(
206 shouldUseAscii() ? ">" : "●",
207 )} ${this.highlight(choice.label)} ${
208 choice.hint ? color.dim(choice.hint) : ""
209 }`
210 : color.dim(
211 `${prefix} ${shouldUseAscii() ? "—" : "○"} ${choice.label} `,
212 ),
213 )
214 .join("\n"),
215 );
216 }
217 this.outputText = outputText.join("");
218
219 this.out.write(erase.line + cursor.to(0) + this.outputText);
220 }
221}

Callers 10

constructorMethod · 0.95
abortMethod · 0.95
submitMethod · 0.95
deleteMethod · 0.95
_Method · 0.95
resetMethod · 0.95
firstMethod · 0.95
lastMethod · 0.95
upMethod · 0.95
downMethod · 0.95

Calls 5

highlightMethod · 0.95
clearFunction · 0.90
stripFunction · 0.90
shouldUseAsciiFunction · 0.90
pushMethod · 0.65

Tested by

no test coverage detected